センターでタイトルバーを達成するにはどうすればよいですか?私は下の写真で描いた青い線の上に正確にしたい。事前ここセンター上のタイトルバー
のおかげで、私のコードです:
touchでは:
getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
getSupportActionBar().setCustomView(R.layout.abs_layout);
XML:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:text="Home"
android:textColor="#ffffff"
android:id="@+id/mytext"
android:textSize="18sp" />
</LinearLayout>
マイ出力: 私はそのまさに私が描いた青いラインにしたいです下の図のように。
[Androidのツールバーセンターのタイトルとカスタムフォント](http://stackoverflow.com/a/26548766/7871886) –
まだ同じこと: )まだ正確に中心にない – CS9423
私はあなたのソリューションは既に[ここ](http://stackoverflow.com/questions/432037/how-do-i-center-text-horizontally-and-vertically-in-a-textview -on-android?page = 1&tab = votes#tab-top) –