Cela peut se faire assez facilement.
<android.support.design.widget.CoordinatorLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android">
<android.support.design.widget.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#0000"
app:elevation="0dp">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
app:layout_collapseMode="pin"/>
<!--Other collapsing toolbar components here-->
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<!--Your content here-->
</android.support.v4.widget.NestedScrollView>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/curve"
app:layout_anchor="@id/appBar"
app:layout_anchorGravity="bottom"
android:layout_gravity="bottom"/>
</android.support.design.widget.CoordinatorLayout>
Le FrameLayout
ancré au fond des AppBarLayout
agit en tant que récipient pour la voûte plantaire. J'ai créé un drawable vectoriel que j'ai utilisé comme arrière-plan pour la FrameLayout
curve.xml
<vector android:width="100dp"
android:height="40dp"
android:viewportHeight="50"
android:viewportWidth="400"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:pathData="M0,0L400,0L400,50Q200,-50,0,50L0,0"
android:fillColor="@color/colorPrimary"/>
</vector>
Modifier la propriété android:height
du drawable pour contrôler la hauteur que vous voulez l'arc aller
sortie
@commonsware Avez-vous déjà rencontré ce scénario? Des pensées à ce sujet? – RmK