Android开始之布局常用属性

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/line"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"

android:background="#CCDDCC"
>
<!-- android:gravity="center_vertical"
     android:layout_marginLeft="30dp" 位于父布局左边30dp
     控件尺寸用dp ;字体大小sp
      android:paddingTop="40dp" 内边距-->
<Button
android:id="@+id/button1"
android:layout_width="200dp"
android:layout_height="100dp"
android:layout_marginLeft="30dp"
android:layout_marginTop="30dp"

android:paddingTop="40dp"
android:textSize="20sp"
android:text="@string/login" />
<EditText
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint"
/>
</LinearLayout>

posted @ 2017-02-23 23:08  张兮兮  阅读(135)  评论(0编辑  收藏  举报