にカスタム テーマを適用しようとしていActionBar
ますPreferenceFragment
。以下はシーンです。
私のクラスは拡張PreferenceFragment
され、次のようにリソースから設定を追加しています。
addPreferenceFromResource (R.xml.myPrefs);
また、私は書いています:
ActionBar a = getActivity ().getActionBar ();
bar.setNavigationMode (ActionBar.NAVIGATION_MODE_TABS);
styles.xml
ここで、定義した独自のテーマをこのアクション バーに適用したいと思います。現在、アクション バーの高さは、ビューが切り取られているため、タブ ビューよりも小さくなっています。
検索してみましたが、問題の解決策が見つかりませんでした。
上記の 1. と 2. のリンクから、次のことがわかりました。
final Context contextThemeWrapper = new ContextThemeWrapper(getActivity(),R.style.yourCustomTheme);
// clone the inflater using the ContextThemeWrapper
LayoutInflater localInflater = inflater.cloneInContext(contextThemeWrapper);
// inflate the layout using the cloned inflater, not default inflater
return localInflater.inflate(R.layout.yourLayout, container, false);
しかし、これもうまくいきませんでした。
どんな助けでも大歓迎です。