0

すべてのアクティビティで設定する代わりに、テーマでカスタム アクション バー ビューを定義する方法はありますか? 現在、私が持っているすべてのアクティビティに対して onCreate にこのコードがあります:

    View actionBar = getLayoutInflater().inflate(R.layout.action_bar_title, null);     
    getActionBar().setCustomView(actionBar);
4

1 に答える 1

0

カスタム ビューは、アクション バーのスタイルで定義できます。

<style name="MyActionBarStyle" parent="@android:style/Widget.Holo.ActionBar">     
    <item name="android:displayOptions">showCustom</item>
    <item name="android:customNavigationLayout">@layout/action_bar_title</item>
</style>
于 2013-09-25T21:15:03.747 に答える