Android: field layout / pad files

hi did you know that there is a shortcut to customize your layout files, a bit like CSS. for example, not

android:layout_marginTop="20dp" android:layout_marginLeft="20dp" android:layout_marginBottom="10dp" android:layout_marginRight="5dp" 

maybe so?

 android:layout_margin="20dp, 20dp, 10dp, 5dp" 

the same would be for Padding / Radius, etc.

+6
source share
1 answer

if you want to set the same value for all parties, you can use this:

 android:layout_margin="20dp" 

if you have a different value for the whole party, you should set them as follows:

 android:layout_marginTop="20dp" android:layout_marginLeft="20dp" android:layout_marginBottom="10dp" android:layout_marginRight="5dp" 

and the same for filling.

+8
source

Source: https://habr.com/ru/post/911341/


All Articles