android 键盘完成,Android从0到完整项目(9)输入键盘

f82f63353e9b

自定义键盘

f82f63353e9b

自定义View实现支付密码的输入

自定义系统键盘

核心:KeyboardView 与自定义键盘文件 xml一起使用实现

province_keyboard = new Keyboard(mContext, R.xml.province_abbreviation);

number_keyboar = new Keyboard(mContext, R.xml.number_or_letters);

xml 部分代码:

xmlns:android="http://schemas.android.com/apk/res/android"

android:keyWidth="10%p" android:keyHeight="8%p"

android:horizontalGap="0.0px" android:verticalGap="0.0px"

>

android:horizontalGap="1%p" android:keyWidth="8%p"

android:keyEdgeFlags="left" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p"

android:keyEdgeFlags="right"/>

android:horizontalGap="1%p" android:keyWidth="8%p"

android:keyEdgeFlags="left" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p"

android:keyEdgeFlags="right" />

android:horizontalGap="11%p" android:keyWidth="8%p"

android:keyEdgeFlags="left"/>

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p"

android:keyEdgeFlags="right" />

android:keyWidth="13%p" android:keyEdgeFlags="left"

android:isModifier="true" android:isSticky="true" />

android:horizontalGap="8%p" android:keyWidth="8%p"/>

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p" />

android:horizontalGap="2%p" android:keyWidth="8%p"/>

android:keyEdgeFlags="right" android:keyIcon="@drawable/remove_edittext_data"

android:horizontalGap="8%p" android:keyWidth="13%p"

android:isRepeatable="true" />

支付自定义键盘是 上下两个自定义View来实现的。比较简单 不多写了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值