GT-S5360 2.3.6 在横向模式下,ActionBar 高度增加了一倍
步骤: - 使用 setRequestedOrientation() - 将屏幕从竖屏旋转到横屏观察到: - 当处于竖屏模式时,动作栏高度是原来的两倍。 期望: - 动作栏高度保持不变。 已测试的解决方案: - 我尝试按照 http://stackoverflow.com/a/10890402/752174 来强制设置高度,但我观察到相同的行为。 配置: - ActionBarSherlock manifest: android:versionCode="100" android:versionName="4.2.0" - ActionBarSherlock pom: <groupId>com.actionbarsherlock</groupId><version>4.3.1</version> - 该问题在设备 GT-S5360 2.3.6 上出现 - 该问题在我获得的任何其他设备上都不会出现,包括 GT-S583i 2.3.6 或具有 4.x 的终端 - 我的应用程序包含一个活动和多个片段(导航更改当前片段) Manifest: - 我不在 manifest 中使用 "android:configChanges=" <application android:theme="@style/Theme.Sherlock.Light" > <activity android:name=".MainActivity" <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> 代码: public class MainActivity extends SherlockFragmentActivity { /** 由 fragment 的 onResume 方法调用。 */ public void onCurrentFragmentChange(BaseDelegate currentFrag) { // 根据 fragment/终端,活动可能会旋转或不会旋转。 setRequestedOrientation(currentFrag.getRequestedScreenOrientation()); actionbar_loadNavigationList(currentFrag); // 使用 _mActionBar.setListNavigationCallbacks(null 或 adapter) 更新动作栏 currentFrag, currentFrag.isOrientationLandscape()); // 使用 _mActionBar.setNavigationMode(list for portrait, none for landscape); invalidateOptionsMenu() 和 _mActionBar.setTitle() }
内容来源: JakeWharton/ActionBarSherlock