LinearLayout中的项目位置

问题描述:

如何设计一个具有两个按钮(水平)的按钮并在这些按钮下方使用LinearLayout的文本视图(垂直)的Android应用程序?无法让它工作。LinearLayout中的项目位置

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

+0

工作,谢谢。 – Carlj901

+0

我的荣幸。接受回答并关闭问题 –

最好在这种情况下使用RelativeLayout。您刚刚根据您的观点相对彼此的项目描述了您的预期结果。使用比你想象的更简单。

http://developer.android.com/resources/tutorials/views/hello-relativelayout.html

+0

是啊,我以前用过的RelativeLayout,问题是,我想在我的按钮都使用重量。现在我在一个LinearLayout和一个RelativeLayout中的TextView中有我的按钮,但它仍然不会像我想要的那样做。 – Carlj901