Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/198.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在对话活动中设置scrollview_Android_Android Activity_Dialog - Fatal编程技术网

Android 如何在对话活动中设置scrollview

Android 如何在对话活动中设置scrollview,android,android-activity,dialog,Android,Android Activity,Dialog,我希望我的对话框活动滚动其中的视图。我在里面使用了几个编辑文本。在布局中添加更多项会增加对话框活动的大小。这是我不想要的。下面是我的对话活动的xml文件 <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertic

我希望我的对话框活动滚动其中的视图。我在里面使用了几个编辑文本。在布局中添加更多项会增加对话框活动的大小。这是我不想要的。下面是我的对话活动的xml文件

<?xml version="1.0" encoding="utf-8"?>

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


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:weightSum="100"
    android:background="@drawable/bg_offer_coffee"
    android:padding="10dp"
    android:scrollbars="vertical"
    android:scrollbarAlwaysDrawVerticalTrack="true">

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textPersonName"
        android:hint="Enter Name"
        android:gravity="center"
        android:ems="10"
        android:id="@+id/et_name"
        android:layout_marginTop="50dp"/>
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="10"/>

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textEmailAddress"
        android:ems="10"
        android:id="@+id/et_email"
        android:hint="Enter Email"
        android:gravity="center"
        android:layout_gravity="center_horizontal" />
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="10"/>

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="phone"
        android:gravity="center"
        android:hint="Enter contact_number"
        android:ems="10"
        android:id="@+id/et_contact" />
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="10"/>

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textPostalAddress"
        android:ems="10"
        android:gravity="center"
        android:hint="Enter Address"
        android:id="@+id/et_address" />
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="10"/>

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/et_coffee_brand"
        android:hint="Enter Coffee Brand"
        android:gravity="center"/>
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="10"/>

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/et_num_person1"
        android:hint="Enter Num Of Person"
        android:gravity="center"/>
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="10"/>

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/et_num_person2"
        android:hint="Enter Num Of Person"
        android:gravity="center"/>
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="10"/>

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/et_num_person3"
        android:hint="Enter Num Of Person"
        android:gravity="center"/>

</LinearLayout>
</ScrollView>
    </LinearLayout>


请告诉我如何做到这一点,我尝试了许多链接,但没有任何效果。请帮助

但你的布局看起来不错。是的,我以前做过,但现在不行