4.0系统以上自定义标题栏报错解决办法:
1、为布局文件修改style.xml
此处的style.xml在values-11或者value-14中,否侧会报错:you cannot combine custom titles with other title features
1
2
3
4
5
6
7
8
9
10
11
12
13
14 |
<?xml version= "1.0"
encoding= "utf-8" ?> <style name= "CustomizedWindowTitleBackground" > <item name= "android:background" >#047BF0</item> </style> <style name= "titlebarstyle"
parent= "android:Theme" > <item name= "android:windowTitleSize" >55dp</item> <item name= "android:windowTitleBackgroundStyle" > @style /CustomizedWindowTitleBackground</item> <!-- All customizations that are NOT specific to a particular API-level can go here. --> </style> </resources> |
2、在AndroidManifest.xml添加主题样式
android:theme="@style/titlebarstyle"
<activity android:name="com.gnnuit.mobilesafe.ui.TaskManagerActivity" android:label="@string/task_manager" android:theme="@style/titlebarstyle" > </activity>
Android开发如何在4.0及以上系统中自定义TitleBar,布布扣,bubuko.com
Android开发如何在4.0及以上系统中自定义TitleBar
原文:http://www.cnblogs.com/FlySheep/p/3574804.html