自定义控件EditText

在src中的drawable新建myeditext.xml文件
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >

<!-- <gradient
android:angle="45"
android:endColor="#CCCCCC"
android:startColor="#CCCCCC" /> -->
<padding
android:bottom="7dp"
android:left="7dp"
android:right="7dp"
android:top="7dp" />
<!-- 设置圆角矩形 -->
<corners android:radius="10dp" />

<stroke
android:width="5px"
android:color="#1199EF" />
<solid android:color="#ffffff" />

</shape>

在布局EditText中加入

android:background="@drawable/editsharp"

RelativeLayout相对布局

<Button
android:id="@+id/login_btn_register"//设置控件id
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/login_btn_login"//在父控件的下方
android:layout_marginLeft="20dp"离左边缘20dp
android:layout_marginRight="20dp"离右边缘20dp
android:layout_marginTop="20dp"离顶部20dp
android:background="@color/colorPrimary"//设置背景颜色
android:text="注册"//文本
android:textColor="#ffffff"//设置文本颜色为白色
android:textSize="20dp" />//文本字体大小

这是密码输入框输入密码时显示*********

<EditText
android:layout_width="400dp"
android:layout_height="60dp"
android:inputType="textPassword"
android:ems="10"
android:id="@+id/login_edit_pwd"
android:drawableLeft="@android:drawable/ic_lock_idle_lock"//设置图片在EditText右边
android:hint="密码:"
android:layout_below="@+id/login_edit_account"//在父元素下方
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="@drawable/editsharp"//设置EditText的圆角和背景边框
/>

这是账号输入框输入账号显示输入的字符

<EditText
android:layout_width="400dp"
android:layout_height="60dp"
android:inputType="textPersonName"
android:id="@+id/login_edit_account"
android:drawableLeft="@android:drawable/ic_menu_myplaces"
android:hint="手机号:"
android:layout_below="@+id/logo"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="@drawable/editsharp"/>

记住密码款可以勾选
<CheckBox
android:layout_width="100dp"
android:layout_height="20dp"
android:text="记住密码"
android:id="@+id/Login_Remember"
android:layout_below="@+id/login_edit_pwd"
android:checked="false"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:textSize="14dp" />

android界面的更多相关文章

  1. Android界面组件的四种启动方式

    Android界面组件启动有四种方式 standard,singleTop,singleTask,singleInstance. standard:每次调用都会都会产生新的组件. singletop: ...

  2. android 界面设计基本知识Ⅲ

    本章继续讲述在android界面设计中相关的知识点.介绍内容包括BroadcastReceiver(广播),Service(服务),Widget(小部件),WebView(网页加载控件). 1.Bro ...

  3. android 界面设计基本知识Ⅱ

    上一章讲述了Android界面设计时,一些基本控件的使用,本章主要讲述自定义控件,Fragment和Headler线程机制. 1.自定义控件 (1)基本知识 dp.sp和dx      px:像素点  ...

  4. 使用HTML来生产Android界面

    使用HTML来生产Android界面 (2013-03-11 17:50:39) 转载▼   分类: Android 1. HTML 开发软件界面   因为android软件开发分工目前还没有细化,程 ...

  5. 【Android源代码下载】收集整理android界面UI效果源码

    在Android开发中,Android界面UI效果设计一直都是很多童鞋关注的问题,今天给大家分享下大神收集整理的多个android界面UI效果,都是源码,都是干货,贡献给各位网友! 话不多说,直接上效 ...

  6. 在Android界面特效中如何做出和墨迹天气及UC中左右拖动的效果

    (国内知名Android开发论坛eoe开发者社区推荐:http://www.eoeandroid.com/) 在Android界面特效中如何做出和墨迹天气及UC中左右拖动的效果 相信这么多手机APP中 ...

  7. Android界面布局基本知识简述

    Android手机操作系统在模拟器中进行相关的编写,可以帮助我们实现各种功能需求.尤其是在界面的操作方面显得更为突出.在这里我们就可以对Android界面布局的相关操作来对这方面的知识进行一个深入的了 ...

  8. Android界面刷新方法

    Android提供了Invalidate方法实现界面刷新,但是Invalidate不能直接在线程中调用,因为他是违背了单线程模型:Android UI操作并不是线程安全的,并且这些操作必须在UI线程中 ...

  9. android界面设计之布局管理

    谈到android界面设计,各种布局样式不得不提!传统的布局方式有6种,我们会一一介绍. 在android studio2.2版本之后出现了一款超棒的布局方式,真正意义上的所见即所得,后面我们也会讲到 ...

  10. Android界面跳转几种情况

    Android界面简单跳转, Intent intent =new Intent(MainActivity.this,SecondActivity.class); startActivity(inte ...

随机推荐

  1. Golang之定时器,recover

    滴答滴答……定时器的使用 package main import ( "fmt" "time" ) //定时器的使用 func main() { t := ti ...

  2. Linux动态共享库

    Linux操作系统上面的动态共享库大致分为三类:   一.操作系统级别的共享库和基础的系统工具库 libc.so, libz.so, libpthread.so等等,这些系统库会被放在/lib和/us ...

  3. oracle使用 merge 更新或插入数据

    OracleCC++C#  总结下.使用merge比传统的先判断再选择插入或更新快很多. 1)主要功能 提供有条件地更新和插入数据到数据库表中 如果该行存在,执行一个UPDATE操作,如果是一个新行, ...

  4. action spring 注入错误,如果检查各项注入都没有错误时,考虑struts 是否配置了namespace(如果你有多个namespace="/")

    [ERROR] 2015-01-04 09:42:35,180 (CommonsLogger.java:38) - Exception occurred during processing reque ...

  5. kafka系列 -- 基础概念

    kafka是一个分布式的.分区化.可复制提交的发布订阅消息系统 传统的消息传递方法包括两种: 排队:在队列中,一组用户可以从服务器中读取消息,每条消息都发送给其中一个人. 发布-订阅:在这个模型中,消 ...

  6. 2018.10.23 bzoj1297: [SCOI2009]迷路(矩阵快速幂优化dp)

    传送门 矩阵快速幂优化dp简单题. 考虑状态转移方程: f[time][u]=∑f[time−1][v]f[time][u]=\sum f[time-1][v]f[time][u]=∑f[time−1 ...

  7. struts2从浅至深(四)下载文件

    1.创建下载文件动作类 2.配置struts 3.提供一个下载链接 4.下载页面 为什么文件名是链接名 只是以链接名显示,但文件的本身是个图片秩序改掉后缀名就可以了

  8. pytest 简介与安装

    前面我们已经基本上掌握了unittest测试框架,下面我们将学习新的pytest测试框架.之于原因嘛,太流行啦!掌握一个框架是不够的,急需另外一个,于是瞅上了pytest. pytest是什么? py ...

  9. [Android]高低API版本兼容之@TargetApi

    使用@TargetApi annotaion, 使高版本API的代码在低版本SDK不报错 例如: AsyncTask.THREAD_POOL_EXECUTOR, 这个静态变量是API11才有的, 设置 ...

  10. Netty Nio启动全流程

    Netty Nio启动全流程 1. 各组件之间的关系 说明:EventLoopGroup类似线程池,EventLoop为单线程,每个EventLoop关联一个Nio Selector,用于注册Chan ...