Android Studio Design界面不显示layout控件的解决方法

时间:2023-03-09 03:35:24
Android Studio Design界面不显示layout控件的解决方法

发现更改了 layout里面的xml文件后  切换到design后,没有显示控件

解决方法

解决办法:

在 res/values/styles.xml 文件中  将原有的 前面添加 Base.

Theme.AppCompat.Light.DarkActionBar 

如下图所示
<resources>

    <!-- Base application theme. -->
<style name="AppTheme" parent="Base.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>