安卓开发(二)——登录界面样式及设置固定用户名密码

本文介绍了安卓应用开发中创建登录界面的步骤,包括activity_main.xml布局文件中CheckBox的添加,自定义MyEditText样式在styles.xml中的设置,以及LoginActivity.java中Button的点击事件处理。目前,界面功能还在逐步完善中。
摘要由CSDN通过智能技术生成

做了一个非常简单的界面,功能还未完全实现,还在摸索过程中。
首先上图:

在这里插入图片描述

activity_main.xml

这里我的主要改动是加了CheckBox,然后还有添加了一个样式MyEditText,具体设置在res->values->styles.xml中,下面会贴出代码。
此外还给Button设置了OnClick触发事件。

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/timg"
    >
<!--    <ImageView-->
<!--        android:id="@+id/icon"-->
<!--        android:layout_width="wrap_content"-->
<!--        android:layout_height="wrap_content"-->
<!--        android:src="@drawable/icon"-->
<!--        android:layout_below="@+id/setting_btn"/>-->
<CheckBox
    android:id="@+id/remeber"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/password"
    android:theme="@style/MyEditText"/>


    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/remebertext"
        android:layout_below="@+id/password"
        android:layout_toRightOf="@+id/remeber"
        android:layout_margin="10dp"
        android:text="记住密码"
        android:textColor="#ffffff"
        />
    <CheckBox
        android:id="@+id/auto"
        android:layout_width="wrap_content"
        android:layout_height
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值