Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Relative Layout: difference between layout_alignBottom and layout_above

I have read document about those two attributes of relative layout, and try some examples, but still not recognize what difference between them. I have tried some test, but often i have same result, and sometimes, different, but i cannot explain.

Here is description on Android Document :

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.

Thanks :)

like image 639
hqt Avatar asked Aug 14 '26 15:08

hqt


1 Answers

This image explains everything :)

enter image description here

above: the bottom edge of view is placed on top edge of view A

alignBottom: the bottom edge of a view is on the same line View B is.

like image 124
fgeorgiew Avatar answered Aug 16 '26 19:08

fgeorgiew



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!