2012-04-20 92 views

回答

1

將此事寫入您的活動中。

getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.mytitle); 

而mytitle佈局是xml文件,它將顯示爲標題菜單。 以下是一個小例子。

<?xml version="1.0" encoding="utf-8"?> 
<TextView 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/myTitle" 
android:text="custom title bar" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:textColor="@color/titletextcolor" 
android:gravity ="center"/> 

,如果你只有想寫THEN

setTitle("Your TITLE"); 

你可以自己製作。其他參考文獻Reference 1Reference 2

相關問題