【发布时间】:2016-10-07 23:16:19
【问题描述】:
我需要使 FloatingActionButton 始终粘在显示 WebView 的片段底部。问题是我当前 XML 中的按钮被切成了两半,我无法修复它。这是我的布局。
<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>
我做错了什么?任何想法如何解决这一问题?这是我的应用程序现在的屏幕截图。
【问题讨论】:
标签: android android-layout android-fragments android-coordinatorlayout floating-action-button