android:layout_alignRight="ID" 和 android:layout_toRightOf="ID" 有什么区别?
What is the difference between android:layout_alignRight="ID" and android:layout_toRightOf="ID"?
android:layout_alignRight="@id/someId"
和android:layout_toRightOf="@id/someId"
有什么区别?
layout_alignRight
对齐两个视图的右边缘。
layout_toRightOf
将此视图的左边缘与另一个 someId
视图的右边缘对齐。
文档:http://developer.android.com/reference/android/widget/RelativeLayout.LayoutParams.html
这张图片将解释不同之处:
android:layout_alignRight="@id/someId"
和android:layout_toRightOf="@id/someId"
有什么区别?
layout_alignRight
对齐两个视图的右边缘。
layout_toRightOf
将此视图的左边缘与另一个 someId
视图的右边缘对齐。
文档:http://developer.android.com/reference/android/widget/RelativeLayout.LayoutParams.html
这张图片将解释不同之处: