Android手機衛(wèi)士之設(shè)置密碼對話框
本文實現(xiàn)初次設(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="確認密碼" /> <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="確認" /> <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"> <!-- 在去頭的同時還保持高版本的樣式主題 --> <!-- 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>
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
C/C++在Java、Android和Objective-C三大平臺下實現(xiàn)混合編程
本文主要介紹C/C++在Java、Android和Objective-C三大平臺下實現(xiàn)混合編程,這里舉例說明實現(xiàn)不同平臺用C/C++實現(xiàn)編程的方法,有興趣的小伙伴可以參考下2016-08-08android中實現(xiàn)OkHttp下載文件并帶進度條
本篇文章主要介紹了android中實現(xiàn)OkHttp下載文件并帶進度條,OkHttp是比較火的網(wǎng)絡(luò)框架,它支持同步與異步請求,支持緩存,可以攔截,更方便下載大文件與上傳文件的操作,有興趣的可以了解一下2017-07-07Android實現(xiàn)完整游戲循環(huán)的方法
這篇文章主要介紹了Android實現(xiàn)完整游戲循環(huán)的方法,以實例代碼形式較為詳細的分析了Android游戲循環(huán)的實現(xiàn)技巧,具有一定參考借鑒價值,需要的朋友可以參考下2015-10-10Android 中 EventBus 的使用之多線程事件處理
這篇文章主要介紹了Android 中 EventBus 的使用之多線程事件處理的相關(guān)資料,需要的朋友可以參考下2015-11-11android如何默認打開小區(qū)廣播具體實現(xiàn)
小區(qū)廣播的開關(guān),1是打開,0是關(guān)閉;0x00就默認關(guān)閉,改成0x01就是默認打開,具體修改如下,感興趣的朋友可以參考下哈2013-06-06Android 將本地資源圖片轉(zhuǎn)換成Drawable,進行設(shè)置大小操作
這篇文章主要介紹了Android 將本地資源圖片轉(zhuǎn)換成Drawable,進行設(shè)置大小操作,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-08-08