-4

I always struggled when and where to use layout_gravity and gravity. Pleaae help me

Prakash
  • 34
  • 1
  • 4

1 Answers1

1

Easy trick to remember: Take "layout-gravity" as "Lay-outside-gravity"

Their names should help you:

  1. android:gravity sets the gravity of the content of the View its used on.
  2. android:layout_gravity sets the gravity of the View or Layout in its parent.

And an example is here.