What is the difference between gravity and layout_gravity in Android?

前端 未结 20 1566
庸人自扰
庸人自扰 2020-11-21 11:41

I know we can set the following values to the android:gravity and android:layout_gravity properties:

    <
20条回答
  •  耶瑟儿~
    2020-11-21 12:29

    Gravity is used to set text alignment in views but layout_gravity is use to set views it self. Lets take an example if you want to align text written in editText then use gravity and you want align this editText or any button or any view then use layout_gravity, So its very simple.

提交回复
热议问题