阅读背景:

Android实战简易教程-第七十枪(自定义实用控制之-邮箱验证EditText)

来源:互联网 

我们自定义一款可以验证用户输入邮箱是不是符合规范的EditText.

1.布局文件:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="https://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="46dp"
    android:background="@android:color/white" >

    <EditText
        android:id="@+id/edittext"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/bg_edittext"
        android:paddingLeft="50dp" />

    <RelativeLayout
        android:layout_width="46dp"
        android:layout_height="match_parent" >

        <ImageView
            android:id="@+id/image"
            android:layout_width="22dp"
            android:layout_height="30dp"
            android:layout_centerInParent="true"
            android:scaleType="centerInside" />
    </RelativeLayout>

</RelativeLayout><?xml 




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: