Android手机卫士之设置密码对话框
更新时间:2016年10月09日 10:00:54 作者:wuyudong
这篇文章主要为大家详细介绍了Android手机卫士之设置密码对话框,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
本文实现初次设置密码验证过程,首先实现如下效果

布局如下:
<?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="设置密码" /> <EditText android:id="@+id/et_set_psd" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="设置密码" /> <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>
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。
相关文章
详解基于Android的Appium+Python自动化脚本编写
这篇文章主要介绍了详解基于Android的Appium+Python自动化脚本编写,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧2020-08-08
详解Android中visibility属性VISIBLE、INVISIBLE、GONE的区别
在Android开发中,大部分控件都有visibility这个属性,其属性有3个分别为“visible ”、“invisible”、“gone”。主要用来设置控制控件的显示和隐藏。本文就详细的讲解一下。2016-12-12
Android编程之基于Log演示一个activity生命周期实例详解
这篇文章主要介绍了Android编程之基于Log演示一个activity生命周期,结合完整实例形式较为详细的分析总结了Log演示activity生命周期的具体用法及Log的具体使用方法,需要的朋友可以参考下2015-12-12
Android、iOS和Windows Phone中的推送技术详解
这篇文章主要介绍了Android、iOS和Windows Phone中的推送技术详解,推送技术的实现通常会使用服务端向客户端推送消息的方式,也就是说客户端通过用户名、Key等ID注册到服务端后,在服务端就可以将消息向所有活动的客户端发送,需要的朋友可以参考下2015-01-01
浅析AndroidStudio3.0最新 Android Profiler分析器(cpu memory network
Android Profiler分为三大模块: cpu、内存 、网络。本文给大家介绍AndroidStudio3.0最新 Android Profiler分析器(cpu memory network 分析器)的相关知识,他们的基本使用方法,在文中都给大家提到,具体内容详情大家通过本文一起学习吧2017-12-12


最新评论