四个验证码框Android,GitHub - MrPsw/VerificationCodeView: Android 自定义方形输入框,仿滴滴验证码输入框...

VerificationCodeView

Android 自定义方形输入框,仿滴滴验证码、小篮单车验证码输入框

效果图

screenshot.gif

GIF被压缩的有点模糊,下面是截图

1d9dfa3e20e0de1ea9bc8aff699f2cf5.png

用法

android:id="@+id/verificationcodeview"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_marginTop="30dp"

android:gravity="center"

android:orientation="horizontal"

app:vcv_et_bg="@drawable/et_login_code"

app:vcv_et_cursor="@drawable/et_cursor"

app:vcv_et_inputType="number"

app:vcv_et_number="4"

app:vcv_et_text_color="@android:color/black"

app:vcv_et_text_size="6sp" />

输入完成监听

verificationcodeview.setOnCodeFinishListener(new VerificationCodeView.OnCodeFinishListener() {

@Override

public void onComplete(String content) {

textView.setText(content);

}

});

所有属性

vcv_et_bg 背景示例(默认)

vcv_et_cursor 光标示例(默认)

android:shape="rectangle">

Gradle

Step 1. Add it in your root build.gradle at the end of repositories:

allprojects {

repositories {

...

maven { url 'https://jitpack.io' }

}

}

Step 2. Add the dependency

dependencies {

compile 'com.jyn.verificationcodeview:verificationcodeview:1.0.0'

}

开发思路

如果对您有帮助的话,还请给个star,谢谢!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值