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下划线颜色 / 隐藏标题栏的更多相关文章

  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. 【代码笔记】Web-CSS-CSS 语法

    一,效果图. 二,代码. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> ...

  2. 介绍Dynamics 365 Performance Center

    关注本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复257或者20170517可方便获取本文,同时可以在第一间得到我发布的最新的博文信息,follow me!我的网站是 www.luoyong. ...

  3. Building QGIS from source - step by step(随笔3)

    依赖包安装 在编译QGIS前分别需要利用cygwin和OSGeo4W 安装网站上的依赖库.分别需要安装的依赖库可以参考官网,此外对应版本的ygwin和OSGeo4W 也可以在网站上找到下载链接. ht ...

  4. Android为TV端助力 反编译

    http://blog.csdn.net/vipzjyno1/article/details/21039349/ apktool.bat d -f  test.apk  test     这条命令修改 ...

  5. SqlServer主键和自增长设置

    SqlServer主键和自增长设置 Intro 有时候有些 sql 语句有些不太记得了,谨以此文备忘. 设置主键以及自增长可分两种情况: 新创建表 表已创建但是没有设置主键和自增长 新创建表 创建表 ...

  6. Elasticsearch 安装操作手册

    第一部分 ES安装环境的准备和初始化 现在交心的版本Elasticsearch 5.6.3 官方建议安装Oracle的JDK8,安装前先检查机器是否已安装JDK. Step 1 检查环境机器是否已安装 ...

  7. oracle 10g函数大全--日期型函数

    sysdate [功能]:返回当前日期. [参数]:没有参数,没有括号 [返回]:日期 [示例]select sysdate hz from dual; 返回:2008-11-5 add_months ...

  8. libstdc++适配Xcode10与iOS12

    编译报错 当你开心得升级完新 macOS,以及新 XCode,准备体验了一把 Dark Mode 编程模式,开心的打开自己的老项目的时候,发现编译不通过了╮(╯_╰)╭ 如果你的工程中如果依赖 lib ...

  9. 关于tomcat 配置时一闪而过的问题

    TOMCAT JAVA_HOME or JRE_HOME environment variable is not defined correctly 按照教程已经安装了JDK并设置好了JAVA_HOM ...

  10. 替换空格[by Python]

    题目: 请实现一个函数,将一个字符串中的空格替换成“%20”.例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy. 1.使用python自带的repla ...