android:设计一个带有可滚动部分的活动

android:设计一个带有可滚动部分的活动,android,scrollview,Android,Scrollview,我的活动包含以下4个部分: <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"></LinearLayout&g

我的活动包含以下4个部分:

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"></LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"></LinearLayout>
    <ScrollView>
        <LinearLayout></LinearLayout>
    </ScrollView>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"></LinearLayout>
</RelativeLayout>


scrollview的正确布局属性是什么

我认为这应该行得通。

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

    <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" >

            <!-- your layouts.. -->
            <!-- layouts in here will be in the scrollview -->
        </LinearLayout>
    </ScrollView>

</LinearLayout>

试试这个

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"></LinearLayout>
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"></LinearLayout>
<ScrollView
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1">
    <!-- put your scrolling stuff here it needs
       to exceed the height of the view to scroll -->
</ScrollView>
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"></LinearLayout>
</LinearLayout>


你想滚动哪个部分?滚动视图必须包含应该滚动的部分。滚动视图内部有一个线性布局…@code学徒:对不起,你的回答让我发笑。原因有两个:一是它不回答OP,二是因为文本的简洁性D
我觉得这是空的。您遗漏了什么吗?这不包括
滚动视图
之外的布局。