Android Studio, New Blank App layout not showing controls

I’ve found with Android Studio 3.1.3 that when you create a new empty activity project. That the designer doesn’t show the Hello World TextView it’s in the xml file. To solve this problem i’ve found that changing the styles.xml file in the res folder from the following:

<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>

</resources>

And adding Base in front of Theme as shown below solves the problem

<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">

I did have a problem where android studio couldn’t resolve Base.Theme, but that was resolved by upgrading the Kotlin plugin. I’d updated the appropriate line in the projects gradle.build file but I hadn’t updated the plugin.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.