android - 相对布局 : difference between layout_alignBottom and layout_above

标签 android android-layout android-relativelayout

我已经阅读了有关相对布局的这两个属性的文档,并尝试了一些示例,但仍然无法识别它们之间的区别。我已经尝试了一些测试,但我经常得到相同的结果,有时,不同的,但我无法解释。

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.

谢谢:)

最佳答案

这张图片说明了一切:)

enter image description here

上图: View 的底部边缘放置在 View A 的顶部边缘

alignBottom: View 的底部边缘与 View B 在同一条线上。

关于android - 相对布局 : difference between layout_alignBottom and layout_above,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19890973/

相关文章:

Android View /布局屏蔽

android - 电报安卓消息单元格

android - 两个带 Android 的屏幕/显示器?

android - 相对布局无法正确呈现

android - 使用房间持久库更新参数

按任意键时android编辑文本隐藏在键盘下方

Android相对布局定位

android - 关于 FragmentTransaction

android - 使用地理定位 api cordova/phonegap 查找距离、速度和加速度

android - 寻找适用于 Android 的 FFmpeg 包装器