0

重複の可能性:
Android:カスタムタイトルバー

アプリケーション名の色を変更するためのカスタムタイトルバーを作成したいのですが、どうすればよいですか?

4

1 に答える 1

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"/>

または、書きたいだけの場合

setTitle("Your TITLE");

あなたはあなた自身のものを作ることができます。その他の参考文献 参考文献 1参考文献 2

于 2012-04-20T05:40:06.700 に答える