2015-02-11 61 views
0

正如标题所述,在使用Android Studio v1.0.2(以及最新的Beta版本)时,我的自定义ActionBar主题/样式并未在preivew设计窗格中应用,尽管它们一旦我部署,就会显示在我的应用中。我瞄准棒棒糖。Android ActionBar样式不呈现 - Android Studio

这是什么,这是我如何配置我的样式或渲染问题的结果?

的AndroidManifest.xml

<application 
     android:allowBackup="true" 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" 
     android:theme="@style/ActionBarTheme" > 
... 
</application> 

Styles.xml(V21)

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
    <!-- the theme applied to the application or activity --> 
    <style name="ActionBarTheme" 
     parent="@android:style/Theme.Holo.Light.DarkActionBar"> 
     <item name="android:actionBarStyle">@style/MyActionBar</item> 
    </style> 

    <!-- ActionBar styles --> 
    <style name="MyActionBar" 
     parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse"> 
     <item name="android:background">#FFF37022</item> 
    </style> 
</resources> 

所需的效果是把动作条背景橙色,并且它是在预览窗格中简单地黑尽管是正确的一旦部署到设备。

+0

我认为你应该使用Appcompat而不是holo,因为你的目标是棒棒糖。 – 2015-02-12 05:50:39

回答

0

现在我觉得很蠢,你可以在设计器中通过方向修饰符旁边的下拉菜单指定要渲染的主题。