Android页面布局理解

Android页面布局分为四个:线性布局,框架布局,相对布局,绝对布局

线性布局根据LinearLayout控件(标签)设置出线性效果

 

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center_vertical|center_horizontal"
    android:orientation="vertical">

    <EditText
        android:id="@+id/userName"
        android:layout_width="270dp"
        android:layout_height="wrap_content"
        android:hint="userName" />
    <EditText
        android:id="@+id/Password"
        android:layout_width="270dp"
        android:layout_height="wrap_content"
        android:hint="Password" />

    <Button
        android:id="@+id/button1"
        android:layout_width="270dp"
        android:layout_height="wrap_content"
        android:text="登录" />
</LinearLayout>

框架布局就是根据设置

android:layout_width=""
android:layout_height=""其中的
wrap_content属性和
match_parent属性来控制页面的效果

相对布局就是用:Android:laout_ofleftto(    )

绝对布局就是用坐标定位Button和TextView

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值