Приведите два поля ввода linea одинаковой фиксированной ширины, 50% экрана - PullRequest
0 голосов
/ 22 июля 2010

У меня есть два EditTexts в LinearLayout.

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

Есть идеи?

1 Ответ

2 голосов
/ 22 июля 2010

Это то, что вы преследовали?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="fill_parent" android:layout_height="wrap_content"
 android:orientation="horizontal">

 <EditText android:id="@+id/TextView01" android:layout_width="fill_parent"
  android:layout_height="wrap_content" android:text="first box"
  android:layout_weight="1" ></EditText>

 <EditText android:id="@+id/TextView02" android:layout_width="fill_parent"
  android:layout_height="wrap_content" android:text="second box"
  android:layout_weight="1"></EditText>
</LinearLayout>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...