这里写自定义目录标题
验证码输入框器
最近在公司做项目的时候,做到了需要用到验证码的地方,因为之前做也没写过,这样的于是在网上百度了一下,发现是五花八门的,没有找到一个感觉实用的东西,也就自己想办法,用自己的思路做了一个,在这里分享给大家,希望能给同行门一点帮助和思路,看看实际的效果吧!哈哈。
1 开始写布局文件
首先开始要做的就先将这几个输入验证码的框框做出来,不多说直接上代码吧:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="horizontal"
tools:ignore="MissingConstraints">
<EditText
android:id="@+id/num_in1_et"
android:layout_width="45dp"
android:layout_height="45dp"
android:background="@drawable/shape_blue_stroke_5dp"
android:gravity="center"
android:inputType="number"
android:maxLength="1"
android:textColor="#3AB3CB"
android:textSi