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. Arcpy多线程热力图

        起因是这样一段对话,领导:你会用脚本生成热力图图片吗?我:可以研究下.领导:那这个需求就给你了.我:......     经过一番研究,研究出大概的思路,先将有经纬度的表中的数据筛选出表并生成 ...

  2. Android 获取 上下文环境参数 getResources

    1----context.getResources().getConfiguration().orientation;//获取屏幕方向int类型,1:portrait,2:landscape 2--- ...

  3. C#开发WEBService服务 C++开发客户端调用WEBService服务

    编写WEBService服务端应用程序并部署 http://blog.csdn.net/u011835515/article/details/47615425 编写调用WEBService的C++客户 ...

  4. Linux内存描述之内存节点node--Linux内存管理(二)

    1 内存节点node 1.1 为什么要用node来描述内存 这点前面是说的很明白了, NUMA结构下, 每个处理器CPU与一个本地内存直接相连, 而不同处理器之前则通过总线进行进一步的连接, 因此相对 ...

  5. spring3:多数据源配置使用

    0. properties ####################################mysql########################################### d ...

  6. 两种动态SQL

    参考:http://www.cnblogs.com/wanyuan8/archive/2011/11/09/2243483.htmlhttp://www.cnblogs.com/xbf321/arch ...

  7. Scrapy案例01-爬取传智播客主页上的老师信息

    目录 1. 新建scrapy项目 2. 爬虫文件: 2.1. 查看需要爬取内容存在哪里: 2.2. 设置item需要保存的数据变量 2.3. 创建爬虫文件 2.4. 保存数据 2.5. yield的用 ...

  8. ASP.NET MVC学习系列(4)——MVC过滤器FilterAttribute

    1.概括 MVC提供的几种过滤器其实也是一种特性(Attribute),MVC支持的过滤器类型有四种,分别是:AuthorizationFilter(授权),ActionFilter(行为),Resu ...

  9. .NET CORE学习笔记系列(6)——KestrelServer

    原文:http://www.cnblogs.com/artech/p/KestrelServer.html 跨平台是ASP.NET Core一个显著的特性,而KestrelServer是目前微软推出了 ...

  10. AQS框架源码分析-AbstractQueuedSynchronizer

    前言:AQS框架在J.U.C中的地位不言而喻,可以说没有AQS就没有J.U.C包,可见其重要性,因此有必要对其原理进行详细深入的理解. 1.AQS是什么 在深入AQS之前,首先我们要搞清楚什么是AQS ...