在Android工作室的布局设计preVIEW选择目标API [英] Select target API in the Android Studio layout design preview
问题描述
我的应用程序面向API 17,但最小的SDK版本是8。在版面设计preVIEW页,我可以本身怎么我的布局出现在一个API 17版的,但如果我点击API选择下拉菜单,我不能选择的任何其他API级别。 Obviousely我可以运行我在2.3 Android版和真实的设备,我可以看到结果的应用程序,但有什么办法也测试在设计preVIEW页?
My application targets API 17 but the min Sdk version is the 8. In the layout design preview page I can se how my layout appears on an API 17 version, but if I click on the API selector drop down menu, I can't choose any other API level. Obviousely I can run my application in a 2.3 Android version and on a real device I can see the result, but is there a way to test in also in the design preview page?
我的清单片断:
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
推荐答案
更新
其实我发现了什么问题是: 当你安装Android工作室,默认情况下它使用自己的Android SDK(位于在Android Studio.app / SDK文件夹),而不是那些你下载的(例如与Eclipse使用)。
Actually I found out what the problem was: when you install Android Studio, by default it uses its own Android SDK (located in the Android Studio.app/sdk folder), instead of the ones you downloaded (for example to use with Eclipse).
所以我只是有我以为我所用的SDK,我被实际使用的那些之间的misalignement。 要解决这个您有2个选项:
So I simply had a misalignement between the SDK I thought I was using and the ones I was actually using. To solve this you have 2 options:
- 从机器人工作室选择File - >项目结构。在平台设置,你可以添加你(更新)下载的SDK文件夹,并用它为您的项目。
-from Android Studio select File -> Project Structure. Under "platform settings" you can add your (updated) downloaded SDK folder and use it for your projects.
- 开放了Android SDK工作室经理,同时安装旧版本的Android软件开发工具包
-open the Android Studio SDK manager and install also the older android versions SDKs
这篇关于在Android工作室的布局设计preVIEW选择目标API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!