我的目標是增加縱向模式下的ActionBar
高度。我目前設置帶導航標籤的ActionBar以屏幕方向改變高度
安卓actionBarSize
在我的themes.xml。
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="DayTheme" parent="android:style/Theme.Holo.Light">
<item name="android:actionBarSize">@dimen/actionBarHeight</item>
<item name="android:actionBarTabTextStyle">@style/tab_indicator_text_dark</item>
</style>
<style name="NightTheme" parent="android:style/Theme.Holo">
<item name="android:actionBarSize">@dimen/actionBarHeight</item>
<item name="android:actionBarTabTextStyle">@style/tab_indicator_text_light</item>
</style>
</resources>
我得到在橫向模式下,我增加了ActionBar
高度80dp預期的效果。
然而,就我旋轉屏幕到肖像模式高度的變化,像這樣。
注意我做出以下代碼調用。
final ActionBar bar = getActionBar();
bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
bar.setDisplayShowTitleEnabled(false);
bar.setDisplayShowHomeEnabled(false);
我正在使用android 4.2開發Nexus 7。
如何在橫向模式下以縱向模式獲得相同的80dp高度?
我遇到過同樣的問題,我想知道你是否也使用這個「反射破解」來強制嵌入式標籤在操作欄中。 – mdelolmo