Линейный макет с пятью текстовыми представлениями и пятью текстовыми полями редактирования - PullRequest
0 голосов
/ 23 апреля 2011

здесь у меня проблема с макетом, я взял линейный макет внутри относительного макета, и я хочу иметь пять текстовых представлений, и справа от них я хочу добавить пять текстовых полей редактирования, я сделал то же самое, но макетпоказывая только 3 каждый, я имею в виду только три текстовых представления и три текстовых поля редактирования, я не смог решить, кто-то, пожалуйста, помогите с кодом

, пожалуйста, помогите, Спасибо ...!

вот мой код

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

Ответы [ 2 ]

0 голосов
/ 23 апреля 2011

Я скопировал размещенный вами макет xml, и он выглядит так, как я ожидал.

image

Of course, your layout xml has four rows of text views and edit views - not five rows. Therefore, the screenshot has only four such rows.

Is this not what you're getting?

--

Update

To add a fifth row with another text view and edit text, you could just add the following to your original layout xml, just after the ll_four LinearLayout.

    
        
        
    
0 голосов
/ 23 апреля 2011

Привет, Рагхав, можешь опубликовать код макета, чтобы мы могли его проанализировать. Я думаю, что вы можете лучше встроить линейный макет в ScrollView, а для примера см. ссылка

Надеюсь, это будет полезно.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...