Android手机卫士之设置密码对话框
作者:wuyudong 发布时间:2021-08-03 07:24:27
标签: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>
来源:http://www.cnblogs.com/wuyudong/archive/2016/10/08/5939823.html
0
投稿
猜你喜欢
- 在项目迁移到Spring Boot之后,发生内存使用量过高的问题。本文介绍了整个排查过程以及使用到的工具,也非常适用于其他堆外内存排查。背景
- 有时候我们在阅读PDF文档时会遇到这样一种情况:PDF文档页数比较多,但是又没有书签,所以我们不能根据书签快速了解文档所讲解的内容,也不能点
- 本文实例讲述了C#实现对数组进行随机排序类。分享给大家供大家参考。具体如下:这个一个扩充C#随机数发生器的类,可以随机生成指定范围的数字,可
- “读多写少”是大部分项目的一个特点。例如“购物”,总是看的人
- 默认spring只在发生未被捕获的runtimeexcetpion时才回滚。最笨的办法:代码级控制:TransactionAspectSup
- 使用idea的file-》settings-》plugins安装maven helper插件失败,安装页面总是提示installed,在in
- Google在Android 4.4版本加入了半透明的界面样式,在Android 5.0的时候推出了Material Design的概念。这
- Java File类 mkdir 不能创建多层目录File f = new File("/home/jp/Upload"
- 背景描述通常如果需要一次更新多条数据有两个方式:(1)在业务代码中循环遍历逐条更新。(2)一次性更新所有数据(更准确的说是一条sql语句来更
- 一、什么是代理?指为一个目标对象提供一个代理对象, 并由代理对象控制对目标对象的引用. 使用代理对象, 是为了在不修改目标对象的基础上,增强
- 1.首先解释一下什么是方法重载?方法重载是指在同一个类中方法同名,参数不同,调用时根据实参的形式,选择与他匹配的方法执行操作的一种技术。这里
- 下面给大家介绍几种比较常见的解决办法,具体内容如下:1.有时候eclipse不自动编译,把project clean一下,让R.java重新
- 本文介绍了Java实现动态获取图片验证码的示例代码,分享给大家,具体如下:import javax.imageio.ImageIO;impo
- 1、很多资料说,添加以下代码,可以隐藏地址栏,但我试了很多次,貌似不成功啊。<meta name="apple-mobile
- 废话不多说了,下面代码给大家介绍下利用正则表达式判断字符的方法,具体代码如下所示:using System;using System.Tex
- 本文实例为大家分享了java读取cvs文件并导入数据库的具体代码,供大家参考,具体内容如下首先获取文件夹下面的所有类型相同的excel,可以
- 在开发过程中,碰到生成一个List对象,需要对其里面的每个对象都进行校验。但是,这个Lis
- 摘要分析验证码素材图片混淆原理,并采用selenium模拟人拖动滑块过程,进而破解验证码。人工验证的过程1、打开威锋网注册页面2、移动鼠标至
- 准备工作:import java.text.SimpleDateFormat;import java.util.Calendar;impor
- 各位亲们可以尝试以下代码:注:这里我就只有一个html标签对来说明问题了,首部之类的东西,自己添加。<html> &n