2010-07-22 44 views
-1

我在LinearLayout中有兩個EditText。給出兩個linea輸入字段相同的固定寬度,50%的屏幕

我希望這些每個屏幕寬度的一半。我一直在玩佈局權重,但佈局寬度來包裝內容,但字段調整基於他們的輸入長度。

任何想法?

+4

如果問題被替換爲「已解決!!」並且沒有注意到解決方案是什麼,那麼很難成爲其他程序員的資源。 – sarnold 2010-07-22 09:53:39

+1

請用你的解答回答你自己的問題,而不是做@sarn說的話 – Will 2010-07-22 13:15:17

回答

2

這是你之後?

<?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> 
相關問題