解决:Android Studio 不能预览

来源:互联网 发布:无锡大数据it 编辑:程序博客网 时间:2024/06/15 14:53

关于无法预览布局文件,是很苦恼的,有一种快速解决办法:

找到res -> values ->styles.xml,进入styles.xml,将

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

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

其实就是在Theme前面加上Base.即可。


ps:据说出现此种现象是引入的V7包版本太新而adt版本太老导致,可以更新adt版本,但是害怕麻烦的话,就直接改styles.xml即可,在Theme前面加上Base.一切搞定!

0 0