0

내가 만들 필요가 FloatingActionButton 항상 내 조각의 하단에 붙어 WebView 표시합니다. 문제는 현재 XML의 버튼이 절반으로 줄었고 수정할 수 없다는 것입니다. 여기 내 레이아웃입니다.CoordinatorLayout 내부의 WebView 하단에 FloatingButton 스틱을 만드는 방법은 무엇입니까?

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@color/colorBackgroundWhite" 
    tools:context=".fragments.CpuComparisionFragment"> 

    <android.support.design.widget.CoordinatorLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

     <WebView 
      android:id="@+id/web_view" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" /> 

     <android.support.design.widget.FloatingActionButton 
      android:id="@+id/button_compare" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="end|bottom" 
      android:layout_marginBottom="@dimen/fb_margin_16dp" 
      android:layout_marginEnd="@dimen/fb_margin_16dp" 
      android:alpha="0.7" 
      android:src="@drawable/ic_compare" /> 

    </android.support.design.widget.CoordinatorLayout> 

</FrameLayout> 

내가 뭘 잘못하고 있니? 어떤 아이디어가 이것을 고치는 방법? 여기 내 앱이 어떻게 보이는지 스크린 샷이 있습니다.

enter image description here

답변

0

그것은 당신이 당신의 XML 속성의 일부를 지원하지 않습니다에 응용 프로그램을 테스트하는 장치에 설치된 안드로이드 버전을 보인다. 어쨌든 FAB 코드를 아래 스 니펫으로 교체하십시오. 나는 그것이 당신을 위해 일하기를 바랍니다.

 <android.support.design.widget.FloatingActionButton 
       android:id="@+id/button_compare" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_gravity="bottom|right" 
       android:layout_marginBottom="@dimen/fb_margin_16dp" 
       android:layout_marginEnd="@dimen/fb_margin_16dp" 
       android:alpha="0.7" 
       app:layout_anchorGravity="bottom|right|end" 
       android:src="@drawable/ic_compare" /> 
+0

테스트 해 보셨습니까? –

+0

예, 그랬습니다. – DevMike

+0

같은 상황. 이것은 아무 것도 변경하지 않습니다. 버튼은 여전히 ​​반으로 잘립니다. :/ – anton86993

0

을 FrameLayout에 추가하십시오.

+0

그다지 도움이되지 않습니다. ( – anton86993

+0

. coroid 레이아웃뿐만 아니라 webView도 android : fitsSystemWindows = "true"를 추가하십시오. – WannaBeGeek

+0

도 할 수 있습니다. – WannaBeGeek

관련 문제