码迷,mamicode.com
首页 > 移动开发 > 详细

Android 自定义title

时间:2014-08-27 13:02:17      阅读:235      评论:0      收藏:0      [点我收藏+]

标签:android   style   blog   http   color   java   io   ar   2014   

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   style   blog   http   color   java   io   ar   2014   

原文地址:http://blog.csdn.net/devilnov/article/details/38867835

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!