使用浮动操作按钮跨越内容并使其可滚动

时间:2017-01-29 14:01:02

标签: java android xml

我有这个代码,我想让它成为Scrollable,它的内容是什么,最好的方法是什么?我尝试让ScrollView成为所有代码的父级,但它只是不起作用,它只会使所有白色都不可滚动。

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent"
tools:context=".MainActivity">

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

    <LinearLayout android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <LinearLayout
            android:id="@+id/viewOne"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="0.6"
            android:background="@android:color/holo_blue_light"
            android:orientation="horizontal"/>

        <LinearLayout
            android:id="@+id/viewTwo"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="0.4"
            android:background="@android:color/holo_orange_light"
            android:orientation="horizontal"/>

    </LinearLayout>

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="16dp"
        android:clickable="true"
        android:src="@drawable/ic_done"
        app:layout_anchor="@id/viewOne"
        app:layout_anchorGravity="bottom|right|end"
        app:backgroundTint="#FF0000"
        app:rippleColor="#FFF" />

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

先谢谢你们

0 个答案:

没有答案
相关问题