[英]Android Studio 1.4.1 rendering problems
我使用Android Studio 1.4.1,每次创建新项目时,都会出现渲染问题“缺少样式。是为此布局选择的正确主题”。 我尝试选择其他API,但问题仍然存在。
还要附上错误渲染问题的屏幕截图
谁能帮我解决这个问题? 谢谢。
在与已安装的Android SDK相匹配时,Android Studio经常让人脑筋急转弯。 它生成的代码和应用程序样式假定可能未安装特定的SDK版本。 最新版本的Android Studio始终假定您具有最新的SDK。
打开Android SDK Manager(从菜单: Tools->Android->Sdk Manager
)并获取最新的SDK,平台和构建工具。 然后重新启动Android Studio并创建一个新项目。 然后,确保将Android Studio配置为对新项目使用最新的工具。 (文件->项目结构)
如果那行不通,那么就把整个事情吹灭。 从Eclipse迁移到Android Studio时,我不得不做很多事情。
首先转到样式,然后将以下代码粘贴到所有样式文件中
<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
</style>
要么
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.