在android下面的工具栏下面的Scrollview

use*_*166 11 android android-scrollview

是否可以在Android下的工具栏下设置滚动条?我正在尝试滚动条视图我有工具栏附加到我的布局像这样:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        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/layoutcolor_background"
        android:orientation="vertical"
        tools:ignore="ContentDescription,RtlHardcoded,NestedWeights">

        <include
            android:id="@+id/toolbar"
            layout="@layout/main_toolbar" />

        <View
            android:layout_width="match_parent"
            android:layout_height="5dp"
            android:background="@drawable/toolbar_dropshadow" />

        <LinearLayout
            android:id="@+id/aandcID"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="2dp"
            android:layout_marginRight="2dp"
            android:layout_weight=".50"
            android:baselineAligned="false"
            android:orientation="horizontal">

            <RelativeLayout
                android:id="@+id/alayout"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_margin="1dp"
                android:layout_weight=".50"
                android:background="@color/layoutbackgroudforrow"
                android:gravity="center">

                <ImageView
                    android:id="@+id/aimage"
                    android:layout_width="100dp"
                    android:layout_height="100dp"
                    android:layout_centerHorizontal="true"
                    android:paddingBottom="3dp"
                    android:paddingTop="5dp"
                    android:src="@drawable/acc" />

                <TextView
                    android:id="@+id/aType"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/aimage"
                    android:layout_centerHorizontal="true"
                    android:layout_marginTop="5dp"
                    android:ellipsize="end"
                    android:gravity="center"
                    android:paddingLeft="2dp"
                    android:singleLine="true"
                    android:text="Deposit"
                    android:textColor="@color/blackText"
                    android:textSize="18sp"
                    android:textStyle="bold"
                    tools:ignore="RtlSymmetry,RtlHardcoded,HardcodedText" />

                <TextView
                    android:id="@+id/anumber"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/aType"
                    android:layout_centerHorizontal="true"
                    android:layout_marginTop="5dp"
                    android:ellipsize="end"
                    android:gravity="center"
                    android:paddingLeft="2dp"
                    android:singleLine="true"
                    android:text="12345678901234567890"
                    android:textColor="@color/blackText"
                    android:textSize="18sp"
                    tools:ignore="RtlSymmetry,RtlHardcoded,HardcodedText" />

                <ImageView
                    android:id="@+id/rupeeIcon"
                    android:layout_width="12dp"
                    android:layout_height="14dp"
                    android:layout_below="@+id/anumber"
                    android:layout_centerHorizontal="true"
                    android:layout_marginTop="8dp"
                    android:layout_toLeftOf="@+id/accatext"
                    android:background="@drawable/rupees_symbol"
                    android:paddingBottom="2dp"
                    android:visibility="visible"
                    tools:ignore="ContentDescription" />

                <TextView
                    android:id="@+id/accatext"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/anumber"
                    android:layout_centerHorizontal="true"
                    android:layout_marginTop="5dp"
                    android:ellipsize="end"
                    android:gravity="center"
                    android:paddingLeft="2dp"
                    android:singleLine="true"
                    android:text="09876543210987654321"
                    android:textColor="@color/numbertext"
                    android:textSize="16sp"
                    tools:ignore="RtlSymmetry,RtlHardcoded,HardcodedText" />
            </RelativeLayout>
        </LinearLayout>

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/footer_band" />

    </LinearLayout>
</ScrollView>
Run Code Online (Sandbox Code Playgroud)

使用上面的代码..工具栏也滚动,因此它也被削减.有没有办法冻结工具栏,然后滚动其他视图.

如果有人能指导我会很棒吗?

谢谢!

Jin*_*Jin 16

做这样的事情

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

    <include layout="@layout/toolbar" />

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">

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

           <!-- Rest of your content -->

        </LinearLayout>

    </ScrollView>

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)