【发布时间】:2015-07-31 10:29:50
【问题描述】:
我用 gradle 1.2.3 将 android studio 更新到最新版本“1.2.1.1”..但是我的项目和新项目有问题.. 由于这个问题,所有 Layouts 文件都无法显示预览:
Rendering problems
The following classes could not be found: android.support.v7.internal.widget.ActionBarOverlayLayout
我找到了解决方案,将主题更改为:
Base.Theme.Appcompat
但现在它不显示任何自定义视图甚至 Appcompat 视图。它给了我这个错误:
The following classes could not be found: - android.support.v7.widget.Toolbar (Fix Build Path, Create Class)
The following classes could not be found: - CustomView.VoiceView (Fix Build Path, Create Class)
Tip: Try to build the project.
我还尝试将渲染版本更改为 21 而不是 22.. 它不起作用..清理和重建什么都不做.. 提前致谢。
更新[添加style.xml]: 我的样式代码是:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="@style/Base.Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/light_blue_500</item>
<item name="colorPrimaryDark">@color/light_blue_700</item>
<item name="colorAccent">@color/light_ornage_500</item>
</style>
<style name="RevealOrange" parent="@style/Base.Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/light_blue_500</item>
<item name="colorPrimaryDark">@color/light_ornage_700</item>
<item name="colorAccent">@color/light_ornage_500</item>
</style>
</resources>
【问题讨论】:
-
显示你的styles.xml
-
@Nilesh 更新 style.xml 代码..请检查。
-
尝试使用 noActionbar 主题
-
删除了“Base”并没有添加“NoActionBar”但同样的问题..
-
我已发布答案,请检查并恢复
标签: android android-layout android-studio rendering