Android的登录界面(未连接数据库)

一、添加图片

<ImageView
    android:id="@+id/iv"
    android:layout_width="70dp"
    android:layout_height="70dp"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="10dp"
    android:background="@drawable/logo"   //在drawable文件夹下添加图片logo.jgp

二、添加文本框

<LinearLayout
    android:id="@+id/ll_name"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/iv"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="10dp"
    android:layout_marginBottom="5dp"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"

    android:background="@drawable/tran1"   
//在drawable文件夹下添加文本tran1.xml也可以改为android:background=“#ffffff”
    >
    <TextView
        android:id="@+id/tv_name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="10dp"
        android:text="用户名:"
        android:textColor="#000"
        android:textSize="20sp" />

    <EditText
        android:id="@+id/et_name"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="请输入用户名"
        android:layout_marginLeft="5dp"
        android:background="@drawable/tran"
//在drawable文件夹下添加文本tran.xml也可以改为android:background=“#ffffff”
        android:padding="10dp"
        />
</LinearLayout>

密码文本框的设计与上面基本相同

三、添加按键

<Button
    android:id="@+id/bth_1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/ll_mima"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
    android:layout_marginTop="10dp"
    android:background="@drawable/tran2"
//在drawable文件夹下添加文本tran2.xml也可以改为android:background=“#0044ff”
    android:text="登录"
    android:textSize="20sp"
    android:textColor="#ffffff"
    />

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值