Android Studio (IntelliJ/IDEA)在AndroidSDK Leve22报exception raised during rendering : action_bar

Google前几天发布了Android 5.1,开发者SDK也更新到Leve22了,我们用Android Studio开发的时候预览布局文件,比如main_activity.xml时发现没有呈现出来,这是个bug,不过在未来Google肯定会修复的,不过使用ADT开发并没有这个问题,这里提供两种解决方案:

第一种:修改Build的级别为21(推荐使用这个方案),没在stackoverflow发现答案时,我也是这么用的

Android Studio (IntelliJ/IDEA)在AndroidSDK Leve22报exception raised during rendering : action_bar_第1张图片

第二种:修改style中的Theme,因为Android Studio还在使用ActionBar-based themes.

Googlge这里有解决怎么使用新的ActionBar工具栏http://android-developers.blogspot.kr/2014/10/appcompat-v21-material-design-for-pre.html

我们可以在这个基础上修改:

<style name="AppTheme.Base" parent="Theme.AppCompat">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="android:windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
</style>

文章原文在:http://stackoverflow.com/questions/29034476/android-studio-sdk-version-22-exception-during-rendering-action-bar

你可能感兴趣的:(android,exception,Studio,IntelliJIDEA,action_bar)