Android studio3.1.4佈局文件無法預覽問題

AndroidStudio3.1.4版本,新建項目佈局文件預覽爲空白,並出現“Failed to instantiate one or more classes”提示.
解決方法如下:
進入 res–values–styles.xml文件,將AppTheme – parent的值,在前面加上Base. 即可。

<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>

參考博客:
解決Android studio3.1.2佈局文件無法預覽問題

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章