Android Studio 第五十三期 - 自訂EditText密碼鍵盤

來源:互聯網
上載者:User

標籤:android edittext

    代碼已經整理好,效果如:

    code:

        //設定輸入為Cipher 模式        inputETP1.setInputType(InputType.TYPE_CLASS_NUMBER | EditorInfo.TYPE_NUMBER_VARIATION_PASSWORD);        inputETP1.setDrawableRightListener(new EditTextPassword.DrawableRightListener() {            @Override            public void onDrawableRightClick() {                //同樣地可以在這可以實現其他的效果,比如一鍵清空                if (mIsShow1) {                    inputETP1.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.eye_grey, 0);                    inputETP1.setInputType(InputType.TYPE_CLASS_NUMBER | EditorInfo.TYPE_NUMBER_VARIATION_PASSWORD);                } else {                    inputETP1.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.eye_orange, 0);//                    inputETP.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);                    inputETP1.setInputType(InputType.TYPE_CLASS_NUMBER | EditorInfo.TYPE_NUMBER_VARIATION_NORMAL);                }                mIsShow1 = !mIsShow1;            }        });

    650) this.width=650;" src="https://s3.51cto.com/wyfs02/M00/06/8B/wKiom1m59KeDzXOLAACbVGiWoZ4113.png" title="QQ20170914111544.png" alt="wKiom1m59KeDzXOLAACbVGiWoZ4113.png" />

    地址:https://github.com/geeklx/MyApplication/tree/master/p039_edittextpwd


本文出自 “梁肖技術中心” 部落格,請務必保留此出處http://liangxiao.blog.51cto.com/3626612/1965175

Android Studio 第五十三期 - 自訂EditText密碼鍵盤

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.