0

アプリでアクション バーを使用しています。sherlock ライブラリを使用して Android バージョン 3.0 より下のアクション バーを表示しました。正常に動作しています。アプリにタイトル バーを追加したいのですが、次の操作を行いました。

requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.window_title_layout);

そしてxmlで私はこれをしました:

<style name="title_theme" parent="@style/Sherlock.__Theme.DarkActionBar">
        <item name="android:windowNoTitle">false</item>
        <item name="android:windowTitleSize">50dip</item>
        <item name="android:windowTitleBackgroundStyle">@style/title_theme</item>
    </style>

Android api < 3.0 では動作しましたが、3.0 以上では動作しません。

You cannot combine custom titles with other title feature..
4

1 に答える 1

0

アクションバーはタイトル機能をサポートしているため、タイトルバーを使用する必要はないかもしれません

getSherlockActivity.getSupportActionBar().setTitle("some text");


getSherlockActivity.getSupportActionBar().setCustomView(customNav); getSherlockActivity.getSupportActionBar().setDisplayShowCustomEnabled(true);

于 2013-04-30T11:32:26.493 に答える