资源demo下载地址https://download.csdn.net/download/zxd1314520/10633545
1.依据依赖
compile 'com.jungly:gridPasswordView:0.3'
2.样式布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="com.example.administrator.ceshi.MainActivity"
android:orientation="vertical">
<TextView
android:padding="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#666"
android:gravity="center"
android:text="输入支付密码"/>
<View
android:layout_width="wrap_content"
android:layout_height="1dp"
android:background="#ededed"/>
<TextView
android:padding="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#666"
android:gravity="center"
android:text="提现60元"/>
<com.jungly.gridpasswordview.GridPasswordView
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="40dp"
app:gpvTextColor="#666"
app:gpvTextSize="8dp"
app:gpvLineColor="#dedede"
app:gpvLineWidth="1dp"
app:gpvGridColor="#ffffff"
app:gpvPasswordLength="6"
app:gpvPasswordType="numberPassword"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="忘记密码"
android:textColor="#9BDEEB"
android:layout_marginRight="30dp"
android:layout_marginTop="10dp"
android:layout_gravity="right"/>
</LinearLayout>
3.效果图
一个简单的支付样式就搞定了。