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自动化脚本编写

    这篇文章主要介绍了详解基于Android的Appium+Python自动化脚本编写,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2020-08-08
  • Android GridView仿微信添加多图效果

    Android GridView仿微信添加多图效果

    这篇文章主要为大家详细介绍了Android GridView仿微信添加多图效果,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2018-05-05
  • 详解Android中visibility属性VISIBLE、INVISIBLE、GONE的区别

    详解Android中visibility属性VISIBLE、INVISIBLE、GONE的区别

    在Android开发中,大部分控件都有visibility这个属性,其属性有3个分别为“visible ”、“invisible”、“gone”。主要用来设置控制控件的显示和隐藏。本文就详细的讲解一下。
    2016-12-12
  • Android编程之基于Log演示一个activity生命周期实例详解

    Android编程之基于Log演示一个activity生命周期实例详解

    这篇文章主要介绍了Android编程之基于Log演示一个activity生命周期,结合完整实例形式较为详细的分析总结了Log演示activity生命周期的具体用法及Log的具体使用方法,需要的朋友可以参考下
    2015-12-12
  • Android、iOS和Windows Phone中的推送技术详解

    Android、iOS和Windows Phone中的推送技术详解

    这篇文章主要介绍了Android、iOS和Windows Phone中的推送技术详解,推送技术的实现通常会使用服务端向客户端推送消息的方式,也就是说客户端通过用户名、Key等ID注册到服务端后,在服务端就可以将消息向所有活动的客户端发送,需要的朋友可以参考下
    2015-01-01
  • Android编程实现摄像头临摹效果的方法

    Android编程实现摄像头临摹效果的方法

    这篇文章主要介绍了Android编程实现摄像头临摹效果的方法,涉及Android权限控制、布局及摄像头功能调用等相关操作技巧,需要的朋友可以参考下
    2017-09-09
  • 浅析AndroidStudio3.0最新 Android Profiler分析器(cpu memory network 分析器)

    浅析AndroidStudio3.0最新 Android Profiler分析器(cpu memory network

    Android Profiler分为三大模块: cpu、内存 、网络。本文给大家介绍AndroidStudio3.0最新 Android Profiler分析器(cpu memory network 分析器)的相关知识,他们的基本使用方法,在文中都给大家提到,具体内容详情大家通过本文一起学习吧
    2017-12-12
  • Android如何实现动态滚动波形图(心电图)功能

    Android如何实现动态滚动波形图(心电图)功能

    这篇文章主要介绍了Android如何实现动态滚动波形图(心电图)功能,帮助大家更好的理解和学习使用Android,感兴趣的朋友可以了解下
    2021-03-03
  • Flutter组件状态管理的3种方法

    Flutter组件状态管理的3种方法

    这篇文章主要为大家详细介绍了Flutter组件状态管理的3种方法,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2022-03-03
  • Android实现断点续传功能

    Android实现断点续传功能

    这篇文章主要为大家详细介绍了Android实现断点续传功能,能在上次的断点处继续上传,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2022-07-07

最新评论