textEdit
textEdit可以添加背景图片、渐变色、文字颜色、大小等等

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<!--设置字号为20pt,在文本末尾绘制图片-->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hello World!"
android:textSize="20pt"
android:drawableEnd="@mipmap/ic_launcher"
android:drawableRight="@mipmap/ic_launcher"
/>
<!--设置中间省略,所有字母大写-->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="middle"
android:textAllCaps="true"
android:text="学习Android学习Android学习Android学习Android学习Android学习Android学习Android"
/>
<!--设置文字颜色、大小、使用阴影-->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="测试文字"
android:shadowColor="#00f"
android:shadowDx="10.0"
android:shadowDy="8.0"
android:shadowRadius="3.0"
android:textColor="#ff0"
android:textSize="18pt"
/>
<!--设置可勾选文本-->
<CheckedTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="可勾选的文本"
android:checkMark="@drawable/ok"
/>
<!--指定背景-->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="带边框的文本"
android:textSize="24pt"
android:background="@drawable/bg_border"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="圆角边框,渐变背景"
android:textSize="24pt"
android:background="@drawable/bg_border2"
/>
</LinearLayout>
</ScrollView>
activaty_main.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!--设置背景色为透明-->
<solid android:color="#0000"/>
<!--设置红色边框-->
<stroke android:width="2dp" android:color="#f00"/>
</shape>
bg_border
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!--指定4个圆角的半径-->
<corners
android:topLeftRadius="20dp"
android:topRightRadius="10dp"
android:bottomLeftRadius="20dp"
android:bottomRightRadius="10dp"
/>
<!--指定边框线条的宽度和颜色-->
<stroke
android:color="#f0f"
android:width="4px"/>
<!--指定渐变色-->
<gradient
android:startColor="#f00"
android:centerColor="#0f0"
android:endColor="#00f"
android:type="sweep"/>
</shape>
bg_border2
textEdit的更多相关文章
- DevExpress 为TextEdit设置水印文字
设置水印代码: //设置水印值public static void SetWatermark(this TextEdit textEdit, string watermark) { textEdit. ...
- DevExpress实现为TextEdit设置水印文字
本文实例展示了DevExpress实现为TextEdit设置水印文字的方法,是一个很实用的技巧.分享给大家供大家参考. 转自 http://blog.csdn.net/yh0503/article/d ...
- TextEdit 回车事件
<dxe:TextEdit Name="txtSearchPatientName" KeyDown="txtSearchPatientName_KeyDown_1& ...
- QML之TextEdit
TextEdit显示一个可编辑的,有格式的文本框.它也可以显示明文和富文本.例如:TextEdit { width: 240 text: "<b>Hello</ ...
- QML学习:Rectangle,Text,TextEdit,Flickable,Flipable元素
QML学习:Rectangle,Text,TextEdit,Flickable,Flipable元素 本文博客链接:http://blog.csdn.net/jdh99,作者:jdh,转载请注明. 参 ...
- QT中LineEdit、TextEdit 、PlainTextEdit 三个控件的区别
QLineEdit是单行文本输入,一般用于用户名.密码等少量文本交互地方.QTextEdit用于多行文本,也可以显示HTML格式文本.QPlainTextEdit与QTextEdit很像,但它多用于需 ...
- DevExpress.XtraEditors.TextEdit 设为密码输入框
DevExpress.XtraEditors.TextEdit 设为密码输入框,解决办法: 设计窗口-->属性Properties-->Mask节点-->PasswordChar输入 ...
- 新手使用mac上的textedit写HTML时遇到的问题及解决办法
刚开始在mac上学习HTML,总结一下遇到的问题和解决办法 问题:使用textedit编写html,在网页上却仍然显示的是代码. 解决办法: 打开textedit后打开文本编辑 选择偏好设置 按如图所 ...
- Dev TextEdit 输入提示
TextEdit.Properties.NullValuePromptShowForEmptyValue = true; TextEdit.Properties.NullValuePrompt = “ ...
- Dev的TextEdit控件IP地址的Mask设置
1. 添加TextEdit控件. 2. 选中TextEdit控件,查看控件属性. 3. 展开Properties属性项,找到Mask属性项. 4. 设置Mask属性项的EditMask属性值为:(25 ...
随机推荐
- QT--初识
一.组成QT的基本模块 二.创建一个简单工程 1.工程结构介绍 .pro 文件 QT += core gui # 包含的模块 greaterThan(QT_MAJOR_VERSION, ): QT + ...
- 华为云PaaS首席科学家:Cloud Native +AI,企业数字化转型的最佳拍档
近日,在2019华为全球分析师大会期间,华为云PaaS首席科学家熊英博士在+智能,见未来(华为云&大数据)的分论坛上,从云计算行业发展谈起,深入云原生发展趋势,对华为云智能应用平台做了深度解读 ...
- Jmeter4.0 _Beanshell解析并获取json响应数据数组长度
我们在做jmeter接口测试的时候,有时候碰到开发没返回数据total,只返回了一条条记录,可是呢,我们又需要知道到底返回了多少条数据时,咋办呢?咋办呢?咋办呢? 不要急,接下来,让我们见证奇迹是如何 ...
- css Grid布局
CSS Grid 布局完全指南(图解 Grid 详细教程)https://www.html.cn/archives/8510#prop-grid-gap 5分钟学会 CSS Grid 布局https: ...
- MessageBox页面消息弹出框类
MessageBox页面消息弹出框类: public class MessageBox { /// <summary> /// 自定义弹出窗口内容,不跳转 /// </summary ...
- JUC-10-ReadWriteLock读写锁
ReadWriteLock同Lock一样也是一个接口,提供了readLock和writeLock两种锁的操作机制,一个是只读的锁,一个是写锁
- Java四种读取和创建XML文档的例子教程
四种方法解析XML文档:Dom.SAX.JDOM.dom4j 1.了解XML XML,即可扩展标记语言(Extensible Markup Language),标准通用标记语言的子集 ...
- jedis:分片集群使用
jedis使用 引入依赖 <dependency> <groupId>redis.clients</groupId> <artifactId>jedis ...
- LightOJ - 1067 - Combinations(组合数)
链接: https://vjudge.net/problem/LightOJ-1067 题意: Given n different objects, you want to take k of the ...
- Hadoop2.8 安装
一.下载Hadoop与java jdk-8u221-linux-x64.tar.gz Oracle官网下载 hadoop-2.8.5.tar.gz Hadoop官网下载 二.配置服务期间ssh免 ...