android - How to avoid gap between action bar and list in List navigation mode? -
i have activity ab + list navigation mode. in manifest file android:configchanges="orientation|screensize" set activity. when open list ab , rotate device in landscape mode list still visible, there gap between ab , list (due ab changes it's heigh while orientation change).
how correctly handle situation or how can avoid @ all?
this situation similar both devices api 8+ , 11+
portrait

and landscape

edited. i've created sample project android 4.0+ w/o abs. result same
private actionbar mactionbar; private static string[] array = {"item1","item2","item3","item4","item4"};
@override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mactionbar = getactionbar(); arrayadapter<string> adapter = new arrayadapter<string>(mactionbar.getthemedcontext(), android.r.layout.simple_spinner_item, array); adapter.setdropdownviewresource(android.r.layout.simple_spinner_dropdown_item); mactionbar.setnavigationmode(actionbar.navigation_mode_list); mactionbar.setlistnavigationcallbacks(adapter, new onnavigationlistener() { @override public boolean onnavigationitemselected(int itemposition, long itemid) { log.d("tag", "item position " + itemposition); return true; } }); } <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name="com.example.ablmtest.mainactivity" android:label="@string/app_name" android:configchanges="orientation|screensize" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> </application>
Comments
Post a Comment