Layout preview rendering problems in android studio(Android Studio 1.2)

我只是一个虾纸丫 提交于 2019-11-29 06:53:58

Try changing your base application theme using below code - in res/values/styles.xml

<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
</style>

OR

Also you can try Switching the preview's API level to lower one from the preview configuration

Antonio Ribeiro

You can also update Gradle to version 1.2.3 as explained here: https://code.google.com/p/android/issues/detail?id=171417

Apparently this was a bug on version 1.2.2 of Gradle and from the next version of Android studio Gradle 1.2.3 will be the default on new projects.

At least it worked for.

While Base.Theme.AppCompat.... is the superclass of Theme.AppCompat.... anyway, I prefer the fix using the new version of Gradle.

Worked for me, hope it works for you.

Also I had to Clean and Rebuild the Project.

The easiest way would be to change the theme of the application by clicking AppTheme.

This does not need to change anything in the code.

I attach the image below

AppTheme example of solution render problem android studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!