1. 程式人生 > >解決:Android Studio 不能預覽

解決:Android Studio 不能預覽

關於無法預覽佈局檔案,是很苦惱的,有一種快速解決辦法:

找到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.一切搞定!