我試圖在水平線性佈局中將一個文本視圖設置爲左側和右側,這是嵌套在嵌套在scrollview中的垂直線性佈局中。水平線性佈局看起來是這樣的:在線性佈局中左對齊
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView android:id="@+id/txtType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:text="Type of Event: "
style="@style/black_text_bold"
android:visibility="gone"/>
<TextView android:id="@+id/outputType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:text="Loading..."
style="@style/black_text"
android:visibility="gone"/>
</LinearLayout>
我該如何去對齊它?我想txttype開始在左邊和輸出類型結束對像正確的:
| |
| txtType: outputType |
| |
謝謝你在前進,
泰勒
在textviews中使用layou_weights。 – njzk2