2017-05-03 1 views
0

플로팅 작업 단추가 코디네이터 레이아웃의 하단 시트 위에 겹치지 않는 문제가 있습니다. 이 문제를 어떻게 해결할 수 있습니까? 기본 배치는 Map Fragment입니다.플로팅 작업 버튼이 겹치지 않음 하단 시트

The layout looks like this

XML은 보이는 다음

<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout 
    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"> 

    <android.support.design.widget.FloatingActionButton 
     android:id="@+id/floatingActionButtonAdd" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginTop="-32dp" 
     android:layout_gravity="end|top" 
     android:src="@drawable/ic_add_white_48dp" 
     app:backgroundTint="@color/colorPrimary" 
     app:borderWidth="0dp" 
     app:elevation="4dp" 
     app:fabSize="normal"/> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical" 
     android:id="@+id/linear_layout_bottom_sheet"> 

     <!-- include bottom sheet --> 
     <include layout="@layout/bottom_sheet_peek" /> 

     <!-- include main content --> 
    <include layout="@layout/bottom_sheet_content" /> 

    </LinearLayout> 
</android.support.design.widget.CoordinatorLayout> 
+0

, 수익 시트의 높이 속성을 FAB보다 높습니다. –

+0

linearlayout 대신 framelayout을 사용해 보았습니까? – Umair

+0

나는이 레이아웃으로는 작동하지 않을 것이라고 생각합니다. FAB은 하단 시트의 일부가 아니어야합니다. – natario

답변

0

가있는 LinearLayout에 긍정적 인 marginTop을 설정하고 부정적인 FAB에서 하나 제거보십시오 : 아마

<?xml version="1.0" encoding="utf-8"?> 


<android.support.design.widget.CoordinatorLayout 
    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"> 

    <android.support.design.widget.FloatingActionButton 
     android:id="@+id/floatingActionButtonAdd" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="end|top" 
     android:src="@drawable/ic_add_white_48dp" 
     app:backgroundTint="@color/colorPrimary" 
     app:borderWidth="0dp" 
     app:elevation="4dp" 
     app:fabSize="normal"/> 

    <LinearLayout 

     android:layout_marginTop="32dp" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical" 
     android:id="@+id/linear_layout_bottom_sheet"> 

     <!-- include bottom sheet --> 
     <include layout="@layout/bottom_sheet_peek" /> 

     <!-- include main content --> 
     <include layout="@layout/bottom_sheet_content" /> 

    </LinearLayout> 
</android.support.design.widget.CoordinatorLayout> 
+0

이도 (https://photos.google.com/share/AF1QipPM0w6Gxo6dXiNHZWIm88BNNJQ_flCHytTKJdHfuH_DEIi8a0ps6zrfgEmaDF4PnA?key=UWpkUERHWjUteDNucWwydjVCLXVGOElHand5UmxB) – Thavit

+0

시도가있는 LinearLayout에 CoordinatorLayout에 투명 배경과 흰색 배경을 설정하려면 [여기 이미지는, 작동하지 않습니다 –

관련 문제