知識(shí)
不管是網(wǎng)站,軟件還是小程序,都要直接或間接能為您產(chǎn)生價(jià)值,我們?cè)谧非笃湟曈X表現(xiàn)的同時(shí),更側(cè)重于功能的便捷,營銷的便利,運(yùn)營的高效,讓網(wǎng)站成為營銷工具,讓軟件能切實(shí)提升企業(yè)內(nèi)部管理水平和效率。優(yōu)秀的程序?yàn)楹笃谏?jí)提供便捷的支持!
Android輸入密碼時(shí)顯示與隱藏
發(fā)表時(shí)間:2020-10-19
發(fā)布人:葵宇科技
瀏覽次數(shù):77
在登錄或者注冊(cè)的時(shí)刻,有些軟件中,需求請(qǐng)求暗碼可以查看和隱蔽,其實(shí)實(shí)現(xiàn)起來也很簡(jiǎn)單。
[img]http://img.blog.csdn.net/20150105175020144?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbGVuZ2d1b3hpbmc=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center
起首定義構(gòu)造:
<LinearLayout android:layout_width="fill_parent" android:layout_height="50.0dip" android:layout_marginLeft="15dip" android:layout_marginRight="15dip" android:background="@drawable/update_password_item_bg_bottom" android:gravity="center_vertical" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="right|center_vertical" android:paddingLeft="5.0dip" android:text="@string/login_pwd" android:textColor="@android:color/black" android:textSize="16.0sp" /> <EditText android:id="@+id/my_lottery_login_page_password" android:layout_width="0px" android:layout_height="fill_parent" android:layout_marginLeft="5.0dip" android:layout_marginRight="5.0dip" android:layout_weight="3" android:background="@android:color/white" android:hint="@string/login_imput_pwd" android:inputType="textPassword" android:maxLength="20" android:paddingLeft="5.0dip" android:singleLine="true" android:textSize="16.0sp" /> <Button android:id="@+id/my_lottery_login_page_show_password" android:layout_width="45dip" android:layout_height="30dip" android:layout_marginRight="3dip" android:background="@drawable/btn_yangzhengma_selector" android:text="顯示" android:textColor="#454545" android:textSize="14sp" /> </LinearLayout>
然后監(jiān)聽那個(gè)按鈕。在java代鋁闥楝定義一個(gè)標(biāo)記
private Boolean showPassword = true; if(showPassword){//顯示暗碼 showPassword = !showPassword; login_show_password.setText("隱蔽"); login_page_password.setTransformationMethod(HideReturnsTransformationMethod.getInstance()); login_page_password.setSelection(login_page_password.getText().toString().length()); }else{//隱蔽暗碼 showPassword = !showPassword; login_show_password.setText("顯示"); login_page_password.setTransformationMethod(PasswordTransformationMethod.getInstance()); login_page_password.setSelection(login_page_password.getText().toString().length()); }
相關(guān)案例查看更多
相關(guān)閱讀
- 汽車回收管理
- 網(wǎng)站建設(shè)百度官方
- 云南網(wǎng)絡(luò)營銷
- 網(wǎng)頁制作
- 云南網(wǎng)站建設(shè)制作
- 百度快速排名
- 小程序開發(fā)聯(lián)系方式
- 小程序生成海報(bào)
- 云南小程序開發(fā)推薦
- 快排推廣
- 云南軟件定制公司
- 開發(fā)框架
- 軟件定制公司
- 云南網(wǎng)站建設(shè)外包
- .net網(wǎng)站
- 搜索引擎自然排名
- 報(bào)廢車拆解軟件
- 智慧農(nóng)貿(mào)市場(chǎng)
- 小程序開發(fā)排名前十名
- 云南小程序開發(fā)報(bào)價(jià)
- 百度小程序公司
- 網(wǎng)站優(yōu)化哪家好
- 開通微信小程序被騙
- 電商網(wǎng)站建設(shè)
- 云南網(wǎng)站建設(shè)首頁
- 全國前十名小程序開發(fā)公司
- 小程序定制
- 報(bào)廢車拆解回收管理系統(tǒng)
- 云南小程序開發(fā)制作
- 汽車報(bào)廢系統(tǒng)