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 ...
随机推荐
- 字符串hash入门
简单介绍一下字符串hash 相信大家对于hash都不陌生 翻译过来就是搞砸,乱搞的意思嘛 hash算法广泛应用于计算机的各类领域,像什么md5,文件效验,磁力链接 等等都会用到hash算法 在信息学奥 ...
- Snapman系统中TCC执行效率和C#执行效率对比
Snapman集合了TCC编译器可以直接编译执行C语言脚本,其脚本执行效率和C#编译程序进行效率对比,包括下面4方面: 1.函数执行效率 2.数字转换成字符串 3.字符串的叠加 4.MD5算法 这是C ...
- Eclipse插件开发教程-插件的导出和安装应用
Eclipse插件可以给开发人员提供不少便利,在很多场景下,插件甚至是必不可少的.那么怎么自己开发一个插件呢?前面两篇讲了怎么开发插件,那么开发完了Eclipse插件之后,怎么使用呢?下面就讲讲插件的 ...
- Error: Invoke-customs are only supported starting with Android O (--min-api 26)
项目报错: 完美解决: 在App下 gradle.build中Android标签中 添加以下内容: compileOptions { sourceCompatibility JavaVersion.V ...
- WordCount结对项目
合作者:201631062124,201631062423 代码地址:https://gitee.com/yryx/WordCount 作业地址:https://edu.cnblogs.com/cam ...
- django源码分析 LazySetting对象
一.django中通过LazySetting对象来获取项目的配置,LazySetting对象有什么特性?为什么使用这个对象? LazySetting顾名思义,就是延迟获取配置内容.比如,我们定义了一个 ...
- Saltstack_使用指南03_配置管理
1. 主机规划 注意事项 修改了master或者minion的配置文件,那么必须重启对应的服务. 2. 了解YAML 具体地址 https://docs.saltstack.com/en/latest ...
- ubuntu18.04搭建hive
hive是基于Hadoop的一个数据仓库工具,可以将结构化的数据文件映射为一张数据库表,并提供简单的sql查询功能,可以将sql语句转换为MapReduce任务进行运行. 其优点是学习成本低,可以通过 ...
- P1546 最短网络 Agri-Net题解(克鲁斯卡尔)
P1546 最短网络 Agri-Net 那么这个题是一道最小生成树的板子题 在此讲解kruskal克鲁斯卡尔方法: 原理: 并查集在这里被用到: 众所周知:树满足这样一个定理:如果 图 中有n个节点并 ...
- Mac进行 usr/bin 目录下修改权限问题,operation not permitted
一般情况下我们在使用mac系统过程中下载一些文件.新建一些项目之后,这些文件都会默认是只读状态,这时我们只需要简单的一句权限设置命令就可以解决 你要修改文件上层目录的路径 但是我们在对 usr/bin ...