Their names should help you:
android:gravitysets the gravity of the contents (i.e. its subviews) of theViewit’s used on.android:layout_gravitysets the gravity of theVieworLayoutrelative to its parent.
And an example is here.
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.