<TextView android:text="ABC"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
下面的代码应该将文本对齐到图像下方的右下角。但这并没有发生
<TextView
android:text="XYZ"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/pic"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"/>
<ImageView
android:src="@drawable/androidparty"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/pic"/>
最佳答案
Android TextView not aligning below ImageView
TextView
未在 ImageView
下方对齐,因为 TextView 的 alignParentBottom
属性设置为 true
。
从 TextView 中移除 alignParentBottom
属性:
<TextView
....
android:layout_below="@id/pic"
android:layout_alignParentRight="true"/>
关于Android TextView 未在 ImageView 下方对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31229535/