What is the difference between gravity and layout_gravity in Android?

Their names should help you:

  • android:gravity sets the gravity of the contents (i.e. its subviews) of the View it’s used on.
  • android:layout_gravity sets the gravity of the View or Layout relative to its parent.

And an example is here.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)