网站大量收购独家精品文档,联系QQ:2885784924

浅谈微交易系统Android支付密码输入框重点.docx

浅谈微交易系统Android支付密码输入框重点.docx

  1. 1、本文档共14页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
浅谈微交易系统Android支付密码输入框有些应用都有支付密码功能,而支付密码的密码输入框确实一个很好玩的控件。虽然网上有很多例子,但是我们网络上有很多实现好的demo,但是抽时间自己设计一个未尝不可啊。看一下效果图我的思路:变成点的控件不是TextView和EditText而是Imageview。首先写一个RelativeLayout里边包含6个ImageView和一个EditText(EditText要覆盖ImageView)将EditText的背景设置成透明。自定义一个控件ItemPasswordLayout,用来给布局做一些处理,重点是将EditText的光标去掉,并监听输入文字的事件在文字变化后将文字放在一个StringBuffer中,并将edittext设置为;再监听按下键盘删除键的事件,当按下删除键后会将StringBuffer中删除相应位置的字符。文/Went_Gone(简书作者)原文链接:/p/01a75d7827d9著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。/** * 密码输入框的控件布局 * Created by Went_Gone on 2016/9/14. */publicclass ItemPasswordLayout extends RelativeLayout{private EditText editText;private ImageView[] imageViews;//使用一个数组存储密码框private StringBuffer stringBuffer = new StringBuffer();//存储密码字符privateint count = 6;private String strPassword;//密码字符串public ItemPasswordLayout(Context context) {this(context,null); }public ItemPasswordLayout(Context context, AttributeSet attrs) {this(context, attrs,0); }public ItemPasswordLayout(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); imageViews = new ImageView[6]; View view = View.inflate(context, R.layout.item_password,this); editText = (EditText) findViewById(R.id.item_edittext); imageViews[0] = (ImageView) findViewById(R.id.item_password_iv1); imageViews[1] = (ImageView) findViewById(R.id.item_password_iv2); imageViews[2] = (ImageView) findViewById(R.id.item_password_iv3); imageViews[3] = (ImageView) findViewById(R.id.item_password_iv4); imageViews[4] = (ImageView) findViewById(R.id.item_password_iv5); imageViews[5] = (ImageView) findViewById(R.id.item_password_iv6); editText.setCursorVisible(false);//将光标隐藏 setListener(); }private void setListener() { editText.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void onTextChanged(Cha

文档评论(0)

shuwkb + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档