<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>
I know I can also use Relativelayout and set alignparentRight=true,to let the right button on the right of this parent,But I just want to know,if I use a LinearLayout,how can I make the right button on the right of it's parent? any help thanks