我已经阅读了有关相对布局的这两个属性的文档,并尝试了一些示例,但仍然无法识别它们之间的区别。我已经尝试了一些测试,但我经常得到相同的结果,有时,不同的,但我无法解释。
Android 文档的描述如下:
android:layout_above
Positions the bottom edge of this view above the given anchor view ID. Accommodates bottom margin of this view and top margin of anchor view.
android:layout_alignBottom
Makes the bottom edge of this view match the bottom edge of the given anchor view ID. Accommodates bottom margin.
谢谢:)
最佳答案
这张图片说明了一切:)
上图: View 的底部边缘放置在 View A 的顶部边缘
alignBottom: View 的底部边缘与 View B 在同一条线上。
关于android - 相对布局 : difference between layout_alignBottom and layout_above,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19890973/