Android 入门(2)修改EditText下划线颜色 / 隐藏标题栏
1 添加颜色
colors.xml中增加
- <color name="colorRed">#FF3300</color>
2 添加style
styles.xml中增加(我这里两个都设置为一样的)
- <style name="MyEditText" parent="Theme.AppCompat.Light">
- <item name="colorControlNormal">@color/colorRed</item>
- <item name="colorControlActivated">@color/colorRed</item>
- </style>
3 LoginActivity中增加
- <?xml version="1.0" encoding="utf-8"?>
- <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context="com.example.tyler.scangun_kps.LoginActivity">
- <ImageView
- android:id="@+id/imageView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:background="@drawable/login_bg"
- android:layout_marginLeft="0dp"
- android:layout_marginTop="0dp"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent" />
- <EditText
- android:id="@+id/etAccount"
- android:layout_width="200sp"
- android:layout_height="wrap_content"
- android:layout_marginLeft="60dp"
- android:layout_marginTop="138dp"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent"
- android:hint="@string/account"
- android:theme="@style/MyEditText"/>
- <EditText
- android:id="@+id/etPwd"
- android:layout_width="200sp"
- android:layout_height="wrap_content"
- android:layout_marginLeft="60dp"
- android:layout_marginTop="200dp"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent"
- android:hint="@string/pwd"
- android:theme="@style/MyEditText"/>
- <com.gc.materialdesign.views.ButtonRectangle
- android:id="@+id/btnLogin"
- android:background="#1E88E5"
- android:layout_width="100sp"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:layout_marginLeft="110dp"
- android:layout_marginTop="270dp"
- android:text="@string/login"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent"/>
- </android.support.constraint.ConstraintLayout>
4 效果(我这里自己增加了背景图)
5 隐藏标题栏
AndroidManifest.xml 文件中
application(全局页面) / activity(局部页面)
- android:theme="@style/Theme.AppCompat.Light.NoActionBar"
Android 入门(2)修改EditText下划线颜色 / 隐藏标题栏的更多相关文章
- TimePickerDialog -下划线颜色修改
首先就是去framework下去找与之相关的theme属性 最开始的时候,直接找的是<item name="datePickerStyle">@style/Widget ...
- iOS - UIButton设置文字标题下划线以及下划线颜色
创建button设置可以折行显示 - (void)viewDidLoad { [super viewDidLoad]; UIButton * button = [[UIButton alloc] in ...
- CSS改变字体下划线颜色
下图是网页中一个非常普通的列表. watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvQXVndXMzMzQ0/font/5a6L5L2T/fontsize/40 ...
- Android 如何自定义EditText 下划线?
项目要求: 笔者曾经做过一个项目,其中登录界面的交互令人印象深刻.交互设计师给出了一个非常作的设计,要求做出包含根据情况可变色的下划线,左侧有可变图标,右侧有可变删除标志的输入框,如图 记录制作过程: ...
- Android设置TextView的行间距,EditText下划线
textView用于显示文本,大量文字显示在一起显得过于紧凑.可通过在布局中更改TextView属性设置行间距. 1.android:lineSpacingMultiplier="1.5&q ...
- android:为TextView加入样式——下划线,颜色,设置链接样式及前背景色
实现下划线及颜色设置: public class AtActivity extends Activity { LinearLayout ll; /** Called when the acti ...
- Android开发之TextView的下划线添加
如何给TextView添加下划线呢,最近项目中需要这个,于是就用代码添加了下划线功能.主要就是用Paint的setFlags方法来实现,具体如下: ((TextView)mScrollView.fin ...
- android ------ 高版本的 Tablayout 下划线宽度
前面呢,有写过TabLayout的博客,最近开发用到了高本版遇到一些问题,来总结一下 Android--------TabLayout实现新闻客户端顶部导航栏 Android中Tablayout设置下 ...
- Delphi中Menu设置Images属性后快捷按键下划线被隐藏解决方法
现象:MainMenu设置Images属性后,看不到快捷按键的下划线,如:新建(&N) 分析:VCL中Menus.pas单元的代码,看到如下语句procedure TMenuItem.Adva ...
随机推荐
- 博弈论进阶之SG函数
SG函数 个人理解:SG函数是人们在研究博弈论的道路上迈出的重要一步,它把许多杂乱无章的博弈游戏通过某种规则结合在了一起,使得一类普遍的博弈问题得到了解决. 从SG函数开始,我们不再是单纯的同过找规律 ...
- cesium 之自定义气泡窗口 infoWindow 后续优化篇(附源码下载)
前言 cesium 官网的api文档介绍地址cesium官网api,里面详细的介绍 cesium 各个类的介绍,还有就是在线例子:cesium 官网在线例子,这个也是学习 cesium 的好素材. 该 ...
- C# 使用NPOI出现超过最大字体数和单元格格式变成一样的解决
在使用NPOI写入Excel文件的时候出现“它已经超出最多允许的字体数”,查询资料发现是字体创建太多的原因,需要将常用字体创建好,传入CellStyle中.参考(http://www.cnblogs. ...
- 2019Java查漏补缺(二)
查看了公众号:java之间的整理的集和文章,文章地址 总结和搜索了一下网络知识,总结了一下: 1.String 的hashcode()方法 2.switch总结: 3.如何实现克隆 1.String ...
- Windbg学习笔记
下载winsdksetup.exe ,双击,选择Debugging Tools for Windows安装. 64位系统抓64位进程dump,用64位windbg来分析.64位系统抓32位进程dump ...
- Sql Server2014数据库清理日志
Sql Server2014数据库日志占用特别大,清理方法.直接贴代码 USE[master] GO ALTER DATABASE db_Name SET RECOVERY SIMPLE WITH N ...
- linux 基础(一)
最近公司涉及到自动化部署的问题,本人见识了后端使用linux命令niu的飞起,一直听说linux,今天开始研究研究linux 首先是下载: 1.要先安装虚拟机2.再安装Ubuntu虚拟机 需要下载Ub ...
- UVALive - 3713 - Astronauts(图论——2-SAT)
Problem UVALive - 3713 - Astronauts Time Limit: 3000 mSec Problem Description Input The input cont ...
- 【题解】P1171 售货员的难题
Tags 搜索,状压. 裸的旅行商问题 #include <stdio.h> #include <string.h> #define re register #define ...
- centos7 python环境安装
https://blog.csdn.net/LeonTom/article/details/81289326