<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="300dp" android:background="#00aaff" android:orientation="vertical" android:padding="5dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="20dp" android:background="#ffff99" android:padding="60dp"> <view android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ff0000"> </view> </LinearLayout> </LinearLayout>
关于Android的margin(当前视图与周围视图的距离)和padding(当前视图与内部内容的距离)
原文:http://www.cnblogs.com/qqhfeng/p/7354630.html