My Aktivität anfordert Layout als Vollbild:fitsSystemWindows auf API16 Gerät nicht funktioniert
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
und in dem XML-Layout setzt die fitsSystemWindows Eigenschaft die statusbar Höhe padding:
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<!-- The main content view -->
<android.support.design.widget.CoordinatorLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
app:contentScrim="@color/actionbar_title_color"
android:fitsSystemWindows="true">
Compiled mit appcompat-v7:23.2.1
, funktioniert es gut auf API21-Gerät, aber auf API16 Gerät die Auffüllung wird nicht angewendet. Irgendwelche Hinweise?
UPDATE
Bounty on: warum auf API16 Gerät die Polsterung nicht angewendet wird?
somit auf API16 sollte ich fitSystemWindows() überschreiben? Ich verstehe nicht warum, wie die Standardimplementierung funktionieren sollte, um die erforderliche Auffüllung hinzuzufügen. – GPack
wenn das nicht funktioniert, müssen Sie condion anwenden, wenn api dies ist (KitKat oder niedriger), der Code für den anderen Code für api level Lollipop –
danke, ich kenne alle diese Posts, aber das Problem hier ist, wie man arbeitet auf API 16 die 'android: fitsSystemWindows = "true"' wie Docs sagt. – GPack