Android 我需要正确使用scrollview

Android 我需要正确使用scrollview,android,android-layout,android-scrollview,xml-layout,Android,Android Layout,Android Scrollview,Xml Layout,我有3个按钮和滚动视图包含文本和图像。 我只想在图像和文本上使用scrollview效果,我的3个按钮固定在scrollview上。我如何才能做到这一点?使用框架布局 下面演示了在带有图像的滚动视图上具有三个按钮的顶部栏的示例 FrameLayout按声明顺序呈现其子对象。对于下面的示例,首先渲染ScrollView,最后渲染LinearLayout按钮栏。这会将该条放置在滚动视图上方,并提供所需的效果 ScrollView将LinearLayout作为子对象的原因是,它们只能有一个子对象 &l

我有3个按钮和滚动视图包含文本和图像。 我只想在图像和文本上使用scrollview效果,我的3个按钮固定在scrollview上。我如何才能做到这一点?

使用框架布局

下面演示了在带有图像的滚动视图上具有三个按钮的顶部栏的示例

FrameLayout按声明顺序呈现其子对象。对于下面的示例,首先渲染ScrollView,最后渲染LinearLayout按钮栏。这会将该条放置在滚动视图上方,并提供所需的效果

ScrollView将LinearLayout作为子对象的原因是,它们只能有一个子对象

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

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

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

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>
        </LinearLayout>
    </ScrollView>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:orientation="horizontal">

        <Button
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"/>

        <Button
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"/>

        <Button
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"/>
    </LinearLayout>
</FrameLayout>

非常感谢,还有一个问题:如何设置屏幕底部的按钮?使用android:layout\u gravity=按钮栏布局的底部。