[英]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.