2011-12-29 45 views

回答

1

您可以使用LineraLayout(或)RelativeLayout(或)TableLayout

這裏是很好的例子:當別人說above..you將不得不把它們放在一個的LinearLayout或RelativeLayout的Android Layout Tutorial

0

例如,您將它們並排放置在水平LinearLayout中。或者在TableLayout的兩列中。順便說一句。要使用的組件是TextView和EditText

+0

你有個例子嗎?謝謝 – cacosud 2011-12-29 23:23:17

+0

感謝您的幫助。 – cacosud 2011-12-30 05:34:14

2

。由於您剛剛開始,我建議使用LinearLayout來代替。像這樣的東西應該工作。

<LinearLayout android:orientation="horizontal" 
      android:layout_height="wrap_content" 
      android:layout_width="fill_parent"> 

<TextView android:text="Please Enter The Number:" 
      android:layout_height="wrap_content" 
      android:layout_width = "wrap_content"/> 

<EditText android:layout_height="wrap_content" 
      android:layout_width="wrap_content"/> 


</LinearLayout> 
+0

非常感謝你們。這工作像一個魅力。我想控制EditTex,就像給他們從邊緣的距離 – cacosud 2011-12-30 00:04:18

+1

如果這回答您的原始問題,請提交它作爲答案。另外,根據你的後續問題得到的結果,你正在尋找的「距邊緣的距離」是一個叫做填充的屬性。將此行添加到您的TextView或EditText標記中。 android:padding =「5dp」。在可視化編輯器中還可以使用其他屬性,只需右鍵單擊該小部件,然後 - >屬性。我建議你使用Layout Gravity,LayoutMarginRight,LayoutPadding等。這些可以讓你更好地控制你的視圖的顯示和位置。 – 2011-12-30 00:26:12

+0

你真棒。非常感謝。 – cacosud 2011-12-30 05:33:56