我在TableRow
内有一个复选框。我想将复选框和文本都对齐到屏幕的右侧,但当我使用android:gravity="right"
时,它只会将文本对齐到屏幕的右侧,而不是方框(复选框本身)。看起来它们是分别对齐的(复选框在左侧,文本在屏幕右侧)。
这里是与复选框相关的xml片段:
<TableRow android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_marginBottom="10dp">
<CheckBox
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Select"
android:id="@+id/checkboxSelect"
android:layout_column="0"
android:layout_weight="1"
android:gravity="right"/>
</TableRow>
我该如何将复选框和上面的文本都靠右对齐?
提前感谢你!