Android 自定义title

requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);   
		setContentView(Res.layout(this, "layout_select"));   //软件activity的布局
		getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, Res.layout(this, "layout_title_bar"));  //titlebar为自己标题栏的布局
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
		


<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">

    <style name="PayHubWindowTitleBackground">
        <item name="android:background">@color/title_bg</item>
    </style>

    <style name="TitleBar_Pay_Hub" parent="android:Theme">
        <item name="android:windowTitleBackgroundStyle">@style/PayHubWindowTitleBackground</item>
    </style>
    
    <style name="TitleTheme" parent="android:Theme">      
          
        <!-- Window attributes -->  
        <item name="android:windowTitleBackgroundStyle">@style/PayHubWindowTitleBackground</item> 
        <item name="android:windowTitleSize">@dimen/title_height</item>
    </style>

</resources>


<activity
            android:name="com.lenovo.newui.SelectActivity"
            android:configChanges="keyboardHidden|orientation|navigation"
            android:screenOrientation="portrait"
            android:theme="@style/TitleTheme" >
        </activity>


Android 自定义title

上一篇:关于Android依赖注入框架ButterKnife和Dagger的简单比较


下一篇:【技术】Media Queries移动设备样式