【发布时间】:2014-02-11 09:41:22
【问题描述】:
我正在使用操作栏,我想自定义操作栏徽标。为此,我编写了代码(如下),但它适用于 Samsung 和 MicroMax 设备,但不适用于 Lenovo K900 和 索尼爱立信 Xperia z1。我该怎么办?
Api 16 可以正常工作,但不能在 17 (4.2) 中运行
代码:
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:actionBarStyle">@style/MyActionBar</item>
</style>
<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:logo">@drawable/product_category_logo</item>
<item name="android:background">@drawable/actionbar_theme</item>
<item name="android:backgroundStacked">@color/black</item>
<item name="android:backgroundSplit">@color/white</item>
<item name="android:textColor">#000000</item>
<item name="android:textSize">16sp</item>
</style>
Values-v14 文件夹:
<resources>
<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
</style>
Values-v11 文件夹:
<resources>
<!--
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
-->
<!-- <style name="AppBaseTheme" parent="android:Theme.Holo.Light"> -->
<style name="AppBaseTheme" parent="android:Theme.Light"><!-- Recent changes -->
<!-- API 11 theme customizations can go here. -->
</style>
伙计,我不知道我该怎么办。请帮帮我。
【问题讨论】:
-
@guys 你在吗??
-
你试过
parent="@style/Widget.Hol..."而不是parent="@android:style/Widget.Hol..."吗? -
“它不工作”是什么意思?
-
@Phil 徽标未显示...什么也没有。
-
在 res 文件夹中有一个 drawable-xxhdpi 文件夹吗?