user3705478 user3705478 - 1 year ago 84
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?

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download