2017-03-02 1 views
0

J'essaie d'implémenter un BottomSheetDialogFragment dans mon application multi-volet. C'est à quoi il ressemble maintenant:BottomSheetDialogFragment dans un seul volet

---------------------------------------- 
|      |    | 
|      |    | 
|  Fragment   | Fragment | 
|      |    | 
|      |    | 
---------------------------------------- 
|  BottomSheetDialogFragment  | 
---------------------------------------- 

Mais ce que je voudrais réaliser est:

---------------------------------------- 
|      |    | 
|      |    | 
|  Fragment   | Fragment | 
|      |    | 
|      |    | 
|------------------------|    | 
|      |    | 
| BottomSheetDialog |    | 
---------------------------------------- 

Ma question est: possible de faire pour y parvenir avec un BottomSheetDialogFragment? Ou aurais-je besoin d'une approche différente? Si c'est possible, pouvez-vous nous indiquer comment je peux y arriver? Merci!

Répondre

0

Vous pouvez essayer d'utiliser un RelativeLayout pour obtenir ce que vous voulez:

<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <FrameLayout 
     android:id="@+id/fragment_container_1" 
     android:layout_width="200dp" 
     android:layout_height="match_parent" 
     android:layout_above="@+id/bottom_dialog"/> 

    <FrameLayout 
     android:id="@+id/bottom_dialog" 
     android:layout_width="0dp" 
     android:layout_height="50dp" 
     android:layout_alignLeft="@+id/fragment_container_1" 
     android:layout_alignRight="@+id/fragment_container_1" 
     android:layout_alignParentBottom="true"/> 

    <FrameLayout 
     android:id="@+id/fragment_container_2" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_toRightOf="@+id/fragment_container_1"/> 

</RelativeLayout>