user3705478 user3705478 - 6 months ago 39
Android Question

When should I use layout_centerHorizontal=true and gravity="center_horizonatal" and foregroundGravity="centerHorizontal"?

I read the documentation, but I am not able get when should I use which?


When you use RelativeLayout - You should use layout_centerHorizontal,layout_centerVertical,layout_centerInParent

but when you use LinearLayout , you should use gravity to align children i.e., layout_gravity and gravity.

foregroundGravity is used with foreground tag. What is in foreground it will align according to foregroundGravity