1 添加颜色

colors.xml中增加

  1. <color name="colorRed">#FF3300</color>

2 添加style

styles.xml中增加(我这里两个都设置为一样的)

  1. <style name="MyEditText" parent="Theme.AppCompat.Light">
  2. <item name="colorControlNormal">@color/colorRed</item>
  3. <item name="colorControlActivated">@color/colorRed</item>
  4. </style>

3 LoginActivity中增加

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. xmlns:app="http://schemas.android.com/apk/res-auto"
  4. xmlns:tools="http://schemas.android.com/tools"
  5. android:layout_width="match_parent"
  6. android:layout_height="match_parent"
  7. tools:context="com.example.tyler.scangun_kps.LoginActivity">
  8.  
  9. <ImageView
  10. android:id="@+id/imageView"
  11. android:layout_width="wrap_content"
  12. android:layout_height="wrap_content"
  13. android:background="@drawable/login_bg"
  14. android:layout_marginLeft="0dp"
  15. android:layout_marginTop="0dp"
  16. app:layout_constraintStart_toStartOf="parent"
  17. app:layout_constraintTop_toTopOf="parent" />
  18.  
  19. <EditText
  20. android:id="@+id/etAccount"
  21. android:layout_width="200sp"
  22. android:layout_height="wrap_content"
  23. android:layout_marginLeft="60dp"
  24. android:layout_marginTop="138dp"
  25. app:layout_constraintStart_toStartOf="parent"
  26. app:layout_constraintTop_toTopOf="parent"
  27. android:hint="@string/account"
  28. android:theme="@style/MyEditText"/>
  29.  
  30. <EditText
  31. android:id="@+id/etPwd"
  32. android:layout_width="200sp"
  33. android:layout_height="wrap_content"
  34. android:layout_marginLeft="60dp"
  35. android:layout_marginTop="200dp"
  36. app:layout_constraintStart_toStartOf="parent"
  37. app:layout_constraintTop_toTopOf="parent"
  38. android:hint="@string/pwd"
  39. android:theme="@style/MyEditText"/>
  40.  
  41. <com.gc.materialdesign.views.ButtonRectangle
  42. android:id="@+id/btnLogin"
  43. android:background="#1E88E5"
  44. android:layout_width="100sp"
  45. android:layout_height="wrap_content"
  46. android:layout_gravity="center"
  47. android:layout_marginLeft="110dp"
  48. android:layout_marginTop="270dp"
  49. android:text="@string/login"
  50. app:layout_constraintStart_toStartOf="parent"
  51. app:layout_constraintTop_toTopOf="parent"/>
  52.  
  53. </android.support.constraint.ConstraintLayout>

4 效果(我这里自己增加了背景图)

  

5 隐藏标题栏

AndroidManifest.xml 文件中

application(全局页面) / activity(局部页面)

  1. android:theme="@style/Theme.AppCompat.Light.NoActionBar"

Android 入门(2)修改EditText下划线颜色 / 隐藏标题栏的更多相关文章

  1. TimePickerDialog -下划线颜色修改

    首先就是去framework下去找与之相关的theme属性 最开始的时候,直接找的是<item name="datePickerStyle">@style/Widget ...

  2. iOS - UIButton设置文字标题下划线以及下划线颜色

    创建button设置可以折行显示 - (void)viewDidLoad { [super viewDidLoad]; UIButton * button = [[UIButton alloc] in ...

  3. CSS改变字体下划线颜色

    下图是网页中一个非常普通的列表. watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvQXVndXMzMzQ0/font/5a6L5L2T/fontsize/40 ...

  4. Android 如何自定义EditText 下划线?

    项目要求: 笔者曾经做过一个项目,其中登录界面的交互令人印象深刻.交互设计师给出了一个非常作的设计,要求做出包含根据情况可变色的下划线,左侧有可变图标,右侧有可变删除标志的输入框,如图 记录制作过程: ...

  5. Android设置TextView的行间距,EditText下划线

    textView用于显示文本,大量文字显示在一起显得过于紧凑.可通过在布局中更改TextView属性设置行间距. 1.android:lineSpacingMultiplier="1.5&q ...

  6. android:为TextView加入样式——下划线,颜色,设置链接样式及前背景色

    实现下划线及颜色设置: public class AtActivity extends Activity { LinearLayout ll;     /** Called when the acti ...

  7. Android开发之TextView的下划线添加

    如何给TextView添加下划线呢,最近项目中需要这个,于是就用代码添加了下划线功能.主要就是用Paint的setFlags方法来实现,具体如下: ((TextView)mScrollView.fin ...

  8. android ------ 高版本的 Tablayout 下划线宽度

    前面呢,有写过TabLayout的博客,最近开发用到了高本版遇到一些问题,来总结一下 Android--------TabLayout实现新闻客户端顶部导航栏 Android中Tablayout设置下 ...

  9. Delphi中Menu设置Images属性后快捷按键下划线被隐藏解决方法

    现象:MainMenu设置Images属性后,看不到快捷按键的下划线,如:新建(&N) 分析:VCL中Menus.pas单元的代码,看到如下语句procedure TMenuItem.Adva ...

随机推荐

  1. 博弈论进阶之SG函数

    SG函数 个人理解:SG函数是人们在研究博弈论的道路上迈出的重要一步,它把许多杂乱无章的博弈游戏通过某种规则结合在了一起,使得一类普遍的博弈问题得到了解决. 从SG函数开始,我们不再是单纯的同过找规律 ...

  2. cesium 之自定义气泡窗口 infoWindow 后续优化篇(附源码下载)

    前言 cesium 官网的api文档介绍地址cesium官网api,里面详细的介绍 cesium 各个类的介绍,还有就是在线例子:cesium 官网在线例子,这个也是学习 cesium 的好素材. 该 ...

  3. C# 使用NPOI出现超过最大字体数和单元格格式变成一样的解决

    在使用NPOI写入Excel文件的时候出现“它已经超出最多允许的字体数”,查询资料发现是字体创建太多的原因,需要将常用字体创建好,传入CellStyle中.参考(http://www.cnblogs. ...

  4. 2019Java查漏补缺(二)

    查看了公众号:java之间的整理的集和文章,文章地址 总结和搜索了一下网络知识,总结了一下: 1.String 的hashcode()方法 2.switch总结: 3.如何实现克隆 1.String ...

  5. Windbg学习笔记

    下载winsdksetup.exe ,双击,选择Debugging Tools for Windows安装. 64位系统抓64位进程dump,用64位windbg来分析.64位系统抓32位进程dump ...

  6. Sql Server2014数据库清理日志

    Sql Server2014数据库日志占用特别大,清理方法.直接贴代码 USE[master] GO ALTER DATABASE db_Name SET RECOVERY SIMPLE WITH N ...

  7. linux 基础(一)

    最近公司涉及到自动化部署的问题,本人见识了后端使用linux命令niu的飞起,一直听说linux,今天开始研究研究linux 首先是下载: 1.要先安装虚拟机2.再安装Ubuntu虚拟机 需要下载Ub ...

  8. UVALive - 3713 - Astronauts(图论——2-SAT)

    Problem   UVALive - 3713 - Astronauts Time Limit: 3000 mSec Problem Description Input The input cont ...

  9. 【题解】P1171 售货员的难题

    Tags 搜索,状压​. 裸的旅行商问题 #include <stdio.h> #include <string.h> #define re register #define ...

  10. centos7 python环境安装

    https://blog.csdn.net/LeonTom/article/details/81289326