我试图在水平线性布局中将一个文本视图设置为左侧和右侧,这是嵌套在嵌套在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