简体   繁体   中英

layout_margin affects top only?

android:layout_margin or android:padding does affect all four directions?

It looks like it sets 'top' and 'left'. Couldn't find the doc to confirm.

Yes, it affects all sides.

android:layout_margin - Specifies extra space on the left, top, right and bottom sides of the view.

android:padding - Sets the padding, in pixels, of all four edges.

I think there is an error in your xml file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM