zoukankan      html  css  js  c++  java
  • Android开发如何在4.0及以上系统中自定义TitleBar

    4.0系统以上自定义标题栏报错解决办法:

    1、为布局文件修改style.xml

    此处的style.xml在values-11或者value-14中,否侧会报错:you cannot combine custom titles with other title features

    <?xml version="1.0" encoding="utf-8"?>
    <resources xmlns:android="http://schemas.android.com/apk/res/android">
    
        <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>
  • 相关阅读:
    adobe acrobat 无效批注对象
    分享下今天研究的流量上限DDos攻击分析和解决方式
    【二】【HTML列表、表格与框架】
    大话计算机中的流水作业
    texinfo
    texindex
    texi2dvi
    tex, virtex, initex
    testprns printername [printcapname]
    testparm
  • 原文地址:https://www.cnblogs.com/FlySheep/p/3574804.html
Copyright © 2011-2022 走看看