Ich möchte meine AppBarLayout ausblenden für das Hinzufügen einer Ansicht dynamisch, die die Höhe des Bildschirms nehmen wird. Dazu möchte ich eine Ansicht temporär entfernen, indem ich die Sichtbarkeit meines AppBarLayout auf GONE setze. Die Ansicht ist nicht sichtbar, aber nehmen Sie Platz auf dem Bildschirm (die Hälfte der Höhe des Bildschirms).AppBarLayout nehmen Platz nach setVisibility (View.GONE)
Meine XML-Code:
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/coordinatorFriendProfil"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#81D4FA"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="@+id/fProfilAppBar"
android:layout_width="match_parent"
android:layout_height="250dp"
android:fitsSystemWindows="true">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/fProfilCollapsing"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#B3E5FC"
android:gravity="center"
android:orientation="vertical"
app:contentScrim="#03A9F4"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<LinearLayout
android:id="@+id/fProfilUserInfo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<com.neden.neden.RoundedImageView
android:id="@+id/ivFriendPicture"
android:layout_width="150sp"
android:layout_height="150sp"
android:layout_gravity="center"
android:fitsSystemWindows="true"
android:src="@drawable/photo"
app:border_color="#64B5F6"
app:border_width="4dp"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7" />
<TextView
android:id="@+id/fProfilName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="15pt" />
</LinearLayout>
<android.support.v7.widget.Toolbar
android:id="@+id/fProfilToolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/fProfilContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
Ich möchte zeigen, das Problem Bild hinzufügen, aber ich kann nicht wegen meiner guten Ruf. Sorry für das sehr schlechte Englisch, ich spreche nicht sehr gut.
Es funktioniert, aber wenn ich dies tun, mein FrameLayout dauert nicht match_parent für die layout_height – Okn
Was Sie tun meine Sprichwort "nimmt Match_parent nicht für die Layout_Height"? Es passt nicht Bildschirm? – mohax
Es tut mir leid für das Englisch. Ich möchte FrameLayout nehmen Sie die gesamte Höhe des Bildschirms, aber wenn ich die appBarLayout, das FrameLayout ist am oberen Rand des Bildschirms, aber nicht am unteren Rand (wie ein margin_bottom, aber ich kann keinen Rand in meinem Code zu sehen). Zur Vereinfachung möchte ich android: layout_height: "match_parent" – Okn