0

标题##我有一个简单的问题。

我正在为应用程序做 UI。我正在使用linearLayout,并为我的内容应用填充,我在第一个o内使用第二个LinearLayout

所以我找到了一个 xml 示例,但我不明白为什么它在 Linearlayout 中使用两个不同的方向?所以在主要的Linearlayout方向设置为水平,但在第二个linearLayout(在第一个内部)方向设置为垂直。对我来说,如果所有内容(按钮和文本视图)都应该只垂直显示,为什么你应该在主线性布局中使用水平方向,这是无稽之谈。

谢谢!

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/background"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="30dip"
android:orientation="horizontal" >
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/main_title" 
android:layout_gravity="center"
android:layout_marginBottom="25dip"
android:textSize="24.5sp"/>
<Button
4

1 回答 1

0

也许在 中linearLayout,程序员希望在同一行TextViewButton彼此并排。

于 2013-11-27T17:54:03.400 回答