2017-02-27 14 views
0

私はGoogle Mapsのような活動をしたいと思います。地図の上に下のシートを作成するにはどうすればよいですか?

ボトムシートを追加しましたが、アプリケーションを実行すると下のシートがマップの下に表示され、他のアクティビティは問題なく表示されます。

マップ上に表示する方法like this?答えは、ないボタンの

<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
     <fragment 
      android:id="@+id/map" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      class="com.google.android.gms.maps.SupportMapFragment" 
      android:layout_marginBottom="56dp"/> 
</RelativeLayout> 

<!-- Bottom Sheet Content --> 
<include layout="@layout/content_bottom_sheet" android:fitsSystemWindows="true"/> 
</android.support.design.widget.CoordinatorLayout> 

答えて

1

コードの下に使用

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" 
    > 



    <fragment 
     android:id="@+id/map" 
     android:name="com.google.android.gms.maps.MapFragment" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginTop="50dp" /> 



    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginBottom="20dp" 
     android:gravity="bottom|center_horizontal" 
     android:orientation="horizontal" 
     android:layout_gravity="bottom"> 

     <Button 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:background="@drawable/texi_white" 
      android:gravity="center" 
      android:text="Map" 
      android:textAllCaps="false" 
      android:textColor="@android:color/darker_gray" 
      android:textStyle="bold" /> 
     <Button 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:background="@drawable/food_white" 
      android:gravity="center" 
      android:text="List" 
      android:textAllCaps="false" 
      android:textColor="@android:color/darker_gray" 
      android:textStyle="bold" /> 

    </LinearLayout> 

</FrameLayout> 

`

+0

おかげでなく、材料設計、BottomSheet –

+0

はいしかし、あなたの代わりにあなたのコントロールを使用することができますの –

関連する問題