android:paddingLeft 和 layout_marginLe 区别

小结:

android:paddingLeft:指的是在本控件中,预留闲置多少空间

android:layout_marginLeft:指的是这个控件距离父控件的空间有多少


<LinearLayout
         android:layout_height =  "28px"
         android:layout_width="fill_parent"
         android:orientation="horizontal"
         android:gravity="center_vertical"
         android:paddingLeft="25px"
         android:background ="@drawable/top_bg"
         >
         <ImageView
             android:layout_width="18px"
             android:layout_height="18px"
             android:src="@drawable/manage"
             ></ImageView>
         <TextView
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:textColor="#000"
             android:textSize="14px"
             android:text="应用程序"
             ></TextView>
         </LinearLayout>
         

android:paddingLeft 和 layout_marginLe 区别_第1张图片

android:paddingLeft:指的是在本控件中,预留闲置多少空间












<LinearLayout
         android:layout_height =  "28px"
         android:layout_width="fill_parent"
         android:orientation="horizontal"
         android:gravity="center_vertical"
         android:layout_marginLeft="25px"
         android:background ="@drawable/top_bg"
         >
         <ImageView
             android:layout_width="18px"
             android:layout_height="18px"
             android:src="@drawable/manage"
             ></ImageView>
         <TextView
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:textColor="#000"
             android:textSize="14px"
             android:text="应用程序"
             ></TextView>
         </LinearLayout>


android:layout_marginLeft:

 指的是这个控件距离父控件的空间有多少android:paddingLeft 和 layout_marginLe 区别_第2张图片








你可能感兴趣的:(android,layout)