我想在一个线性布局中将两个TextView放在左边,将一个按钮放在右边,这可行吗?以下是我的代码,我不得不硬编码按钮的leftMargin,这很不灵活。是否可以布置流向不同方向的子元素?
<LinearLayout
android:id="@+id/widget43"
android:layout_width="fill_parent"
android:layout_height="100px"
>
<TextView
android:id="@+id/tc_buttom_text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Time elapsed"
>
</TextView>
<TextView
android:id="@+id/tc_buttom_text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="00:00:00 00"
>
</TextView>
<Button
android:id="@+id/tc2_home"
android:layout_width="70px"
android:layout_height="wrap_content"
android:layout_marginLeft="200px"
android:layout_marginRight="10px"
android:text="Home"
android:layout_weight="0.5"
>
</Button>
</LinearLayout>