【发布时间】:2016-12-07 16:34:02
【问题描述】:
TableRow 中有一个复选框。我想将复选框和文本都对齐到屏幕的右侧,但是当我使用 android:gravity="right" 时,它只会将文本对齐到屏幕的右侧,而不是正方形(复选框本身)。似乎它们是分开对齐的(屏幕左侧的复选框和右侧的文本)。
这里是引用复选框的xml的sn-p:
<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>
如何将复选框及其上的文本对齐到屏幕右侧?
提前致谢!
【问题讨论】:
-
你的意思是复选框文本向右移动但框不移动??
-
@Andolasoft 是的,就是这样。文本正在向屏幕右侧移动,但框仍在屏幕左侧。
-
stackoverflow.com/questions/3156781/….. 这对你有帮助吗..
-
父布局表布局包含哪些?