Android手機(jī)衛(wèi)士之設(shè)置密碼對(duì)話框
本文實(shí)現(xiàn)初次設(shè)置密碼驗(yàn)證過(guò)程,首先實(shí)現(xiàn)如下效果
布局如下:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <TextView style="@style/TitleStyle" android:background="#f00" android:text="設(shè)置密碼" /> <EditText android:id="@+id/et_set_psd" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="設(shè)置密碼" /> <EditText android:id="@+id/et_confirm_psd" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="確認(rèn)密碼" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <Button android:id="@+id/bt_submit" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="確認(rèn)" /> <Button android:id="@+id/bt_cancel" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="取消" /> </LinearLayout> </LinearLayout>
其中TitleStyle的代碼如下:
<resources> <!-- Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xml on newer devices. --> <style name="AppBaseTheme" parent="android:Theme.Light"> <!-- Theme customizations available in newer API levels can go in res/values-vXX/styles.xml, while customizations related to backward-compatibility can go here. --> </style> <!-- Application theme. --> <style name="AppTheme" parent="AppBaseTheme"> <!-- 在去頭的同時(shí)還保持高版本的樣式主題 --> <!-- All customizations that are NOT specific to a particular API-level can go here. --> <item name="android:windowNoTitle">true</item> </style> <style name="TitleStyle"> <item name="android:gravity">center</item> <item name="android:textSize">20sp</item> <item name="android:textColor">#000</item> <item name="android:padding">10dp</item> <item name="android:background">#0f0</item> <item name="android:layout_width">match_parent</item> <item name="android:layout_height">wrap_content</item> </style> </resources>
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
Android實(shí)現(xiàn)手勢(shì)劃定區(qū)域裁剪圖片
這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)手勢(shì)劃定區(qū)域裁剪圖片,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2022-05-05Android之ProgressBar即時(shí)顯示下載進(jìn)度詳解
這篇文章主要為大家詳細(xì)介紹了Android之ProgressBar即時(shí)顯示下載進(jìn)度,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2016-09-09C/C++在Java、Android和Objective-C三大平臺(tái)下實(shí)現(xiàn)混合編程
本文主要介紹C/C++在Java、Android和Objective-C三大平臺(tái)下實(shí)現(xiàn)混合編程,這里舉例說(shuō)明實(shí)現(xiàn)不同平臺(tái)用C/C++實(shí)現(xiàn)編程的方法,有興趣的小伙伴可以參考下2016-08-08android中實(shí)現(xiàn)OkHttp下載文件并帶進(jìn)度條
本篇文章主要介紹了android中實(shí)現(xiàn)OkHttp下載文件并帶進(jìn)度條,OkHttp是比較火的網(wǎng)絡(luò)框架,它支持同步與異步請(qǐng)求,支持緩存,可以攔截,更方便下載大文件與上傳文件的操作,有興趣的可以了解一下2017-07-07RecyclerView實(shí)現(xiàn)插入和刪除
這篇文章主要為大家詳細(xì)介紹了RecyclerView實(shí)現(xiàn)插入和刪除,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2018-08-08Android實(shí)現(xiàn)完整游戲循環(huán)的方法
這篇文章主要介紹了Android實(shí)現(xiàn)完整游戲循環(huán)的方法,以實(shí)例代碼形式較為詳細(xì)的分析了Android游戲循環(huán)的實(shí)現(xiàn)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-10-10Android 中 EventBus 的使用之多線程事件處理
這篇文章主要介紹了Android 中 EventBus 的使用之多線程事件處理的相關(guān)資料,需要的朋友可以參考下2015-11-11android如何默認(rèn)打開(kāi)小區(qū)廣播具體實(shí)現(xiàn)
小區(qū)廣播的開(kāi)關(guān),1是打開(kāi),0是關(guān)閉;0x00就默認(rèn)關(guān)閉,改成0x01就是默認(rèn)打開(kāi),具體修改如下,感興趣的朋友可以參考下哈2013-06-06Android 將本地資源圖片轉(zhuǎn)換成Drawable,進(jìn)行設(shè)置大小操作
這篇文章主要介紹了Android 將本地資源圖片轉(zhuǎn)換成Drawable,進(jìn)行設(shè)置大小操作,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2020-08-08