我在这里找到了答案,我的第一个问题,我能够成功地设定彼此相邻的我的两个按钮:xml文件:按钮旁边的对方 - 但每个人都有自己的侧
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentTop="false"
android:layout_alignParentLeft="false"
android:layout_alignParentStart="false"
android:layout_alignParentBottom="false"
android:layout_alignParentRight="false"
android:layout_centerHorizontal="true"
android:gravity="center"
android:layout_below="@id/description"
android:layout_alignParentEnd="false">
<!-- Send it Button -->
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/confirm_it"
android:textColor="@color/white"
android:textSize="15sp"
android:layout_weight="0"
android:id="@+id/confirm_button"
android:backgroundTint="@color/darkCyan"
android:onClick="sendName"
/>
<!-- Skip it Button -->
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/skip_it"
android:textColor="@color/white"
android:textSize="15sp"
android:id="@+id/skip_button"
android:backgroundTint="@color/darkCyan"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:onClick="skipName"
/>
</LinearLayout>
现在我想要做别的事情,我仍然希望两个按钮相邻,但是我希望每个例如SEND按钮都位于页面的最左侧,SKIP按钮位于页面的右侧:
这是我想要的:
可能吗?如何?
正是我所需要的。谢谢! – morkuk