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

后端 未结 3 1322
醉梦人生
醉梦人生 2020-12-18 00:08

I have the following error in my preview window in the latest version of Android Studio (1.2) that stops me from being able to view the layout I am creating

相关标签:
3条回答
  • 2020-12-18 00:43

    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.

    0 讨论(0)
  • 2020-12-18 00:50

    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

    0 讨论(0)
  • 2020-12-18 00:56

    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

    enter image description here

    0 讨论(0)
提交回复
热议问题