Android:gravity and android:layout_gravity These two properties believe that everyone usually use quite a lot of it. Have you ever thought about the difference between the two and different?
I believe some children's shoes are very clear, some children's shoes are smattering. Today we will look at the difference between the two, I hope that in the future to better help you to use both properties.
Android:gravity is actually more focused on the control itself, if set android:gravity= "center", which is meant to be centered within the content of the control.
Android:layout_gravity is actually more about the parent control or the layout nested in the outer layer, relative to the parent control rather than its own content. If you set android:layout_gravity= "Center_vertical|center_horizontal",
The intention is that the layout of the control is horizontally vertically centered relative to the outer layer.
I hope you will be able to use these two attributes clearly and accurately later.
Analysis of Android:gravity and android:layout_gravity