Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.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 具有五个文本视图和五个编辑文本框的线性布局_Android_Android Layout - Fatal编程技术网

Android 具有五个文本视图和五个编辑文本框的线性布局

Android 具有五个文本视图和五个编辑文本框的线性布局,android,android-layout,Android,Android Layout,这里我有一个布局问题,我在相对布局中采用了线性布局,我想有五个文本视图,在它们的右侧我想添加五个编辑文本框,我做了同样的操作,但布局每个只显示三个,我是说三个文本视图和三个编辑文本框,我无法解决,请有人帮我写代码 请帮忙,谢谢 这是我的密码 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout android:id="@+id/RelativeLayout01" android:layout_width="fill_par

这里我有一个布局问题,我在相对布局中采用了线性布局,我想有五个文本视图,在它们的右侧我想添加五个编辑文本框,我做了同样的操作,但布局每个只显示三个,我是说三个文本视图和三个编辑文本框,我无法解决,请有人帮我写代码

请帮忙,谢谢

这是我的密码

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/RelativeLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">

<LinearLayout android:id="@+id/ll_one" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal">
    <TextView android:id="@+id/TextView01"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="User Name:"/>
    <EditText android:id="@+id/EditText01"
    android:layout_width="180px"
    android:maxLines="1"

    android:layout_height="wrap_content"/>
</LinearLayout>

<LinearLayout android:id="@+id/ll_two" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_below="@+id/ll_one">
    <TextView android:id="@+id/TextView02"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Password:"/>
    <EditText android:id="@+id/EditText02"
    android:layout_width="180px"
    android:layout_height="wrap_content"
    android:layout_marginLeft="16dip"
    android:maxLines="1"
    android:password="true"
    android:inputType="textPassword"/>
</LinearLayout>


<LinearLayout android:id="@+id/ll_three" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_below="@+id/ll_two">
    <TextView android:id="@+id/TextView03"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Email:"/>
    <EditText android:id="@+id/EditText03"
    android:layout_width="180px"
    android:layout_height="wrap_content"
    android:layout_marginLeft="42dip"
    android:maxLines="1"
    android:password="true"
    android:inputType="textPassword"/>
   </LinearLayout>

<LinearLayout android:id="@+id/ll_four" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_below="@+id/ll_three">
    <TextView android:id="@+id/TextView04"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="First Name:"/>
    <EditText android:id="@+id/EditText04"
    android:layout_width="180px"
    android:layout_height="wrap_content"
    android:layout_marginLeft="42dip"
    android:password="true"
    android:inputType="textPassword"/>
    </LinearLayout>

<LinearLayout android:id="@+id/ll_three" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_alignParentBottom="true">
    <Button 
        android:layout_height="wrap_content" 
        android:text="Sign In"
        android:id="@+id/Button01"
        android:layout_width="fill_parent" 
        android:layout_weight="1"/>
    <Button 
        android:layout_height="wrap_content" 
        android:layout_width="fill_parent" 
        android:id="@+id/Button02"
        android:text="New user"
        android:layout_weight="1"/>
 </LinearLayout>
</RelativeLayout>

你好,Raghav,你能发布布局代码以便我们分析它吗。我认为,您可以更好地将线性布局嵌入到ScrollView中,有关示例,请参考以下内容


希望它会有用。

我复制了您发布的布局xml,它看起来和我期望的一样

当然,布局xml有四行文本视图和编辑视图,而不是五行。因此,屏幕截图只有四行

这不是你得到的吗

--

更新

要使用另一个文本视图添加第五行并编辑文本,只需在ll_four LinearLayout之后将以下内容添加到原始布局xml中即可

    <LinearLayout
        android:id="@+id/ll_five"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_below="@+id/ll_four">
        <TextView
            android:id="@+id/TextView05"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="First Name:" />
        <EditText
            android:id="@+id/EditText05"
            android:layout_width="180px"
            android:layout_height="wrap_content"
            android:layout_marginLeft="42dip"
            android:password="true"
            android:inputType="textPassword" />
    </LinearLayout>


@soorya我把它贴出来了,可以把你的代码贴在这里吗?这样我们就可以看到和找到你的代码了problem@Dharmendra您好,我发布了全部xml代码,请查看一次,我只看到一行代码,而不是整个布局。顺便说一句,你最好看看TableLayout。@Dinash嗨,我发了代码,你能看一下吗?让我知道这个问题code@Dinash我发布了全部代码,但没有显示,怎么办do@Raghav如果您仍在搜索解决方案,请使用scrollview layouthi raghav来完成此操作,并使用scrollview layouthi raghav来包装该表布局。请尝试以下代码“将其放入您的相对布局中”。当您的原始帖子相当混乱时。@raghav我不知道您的问题是什么。如果我现在理解正确,您有四行文本视图和编辑文本显示。如果你想要第五个,我想你知道怎么让它出现,因为你的前四个都很好。如果您只是想添加第五个,请参阅我对这个答案所做的更新,以添加更多的xml。无论如何,如果你能澄清你的问题,这可能对你在这里得到帮助是有益的。谢谢你,我用表格布局来解决prblm,现在它工作了,但以前我坚持使用布局,甚至我不知道为什么会发生这种情况,因为我对安卓是新手。任何人都再次感谢你