<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="left" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="center" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:text="right" />
</LinearLayout>
我知道我也可以使用Relativelayout并设置alignparentRight = true,让右键在这个父级的右边,但我只想知道,如果我使用LinearLayout,我怎样才能在它的右边设置右键父母?任何帮助谢谢