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 ...
随机推荐
- Kotlin属性揭秘与延迟初始化特性
在上一次https://www.cnblogs.com/webor2006/p/11210181.html学习了Kotlin的伴生对象,这次来学习属性相关的东东. 属性揭秘: 先声明一个属性: 没啥可 ...
- js在点击的按钮下面弹框
效果如图,点击对应的按钮时,弹框会在对应的按钮下面显示,可以应用于列表等场景 前端代码 <%@ Page Language="C#" AutoEventWireup=&quo ...
- Redis的缓存穿透问题和雪崩问题?
缓存穿透:就是访问redis中一个不存在的key的时候,会直接穿过缓存,去数据库中进行查询. 如果是黑客,进行恶意攻击的时候,每次都请求超过2000个/秒的时候,这个时候mysql基本上就挂了. 解决 ...
- 扫雷小游戏PyQt5开发【附源代码】
也没啥可介绍哒,扫雷大家都玩过. 雷的分布算法也很简单,就是在雷地图(map:二维数组)中,随机放雷,然后这个雷的8个方位(上下左右.四个对角)的数字(非雷的标记.加一后不为雷的标记)都加一. 如何判 ...
- [BeiJing2010组队]次小生成树 Tree
1977: [BeiJing2010组队]次小生成树 Tree Time Limit: 10 Sec Memory Limit: 512 MBSubmit: 5168 Solved: 1668[S ...
- ES中的分析和分析器
在ES存储的文档,进行存储时,会对文档的内容进行分析和分词 分析的过程: 首先,将一块文本分成适合于倒排索引的独立的 词条 , 之后,将这些词条统一化为标准格式以提高它们的“可搜索性”,或者 reca ...
- jquery中ajax跨域加载
今天学习ajax跨域加载,先来一段代码,异步加载的链接是爱奇艺的开源,我直接拿来用作测试 <!DOCTYPE html> <html lang="en"> ...
- oracle+mybatis报错:BindingException("Invalid bound statement (not found): ")
oracle+mybatis报错:BindingException("Invalid bound statement (not found): ") 从mysql转到oracle数 ...
- 对日开发中 PG , PL , SE , PM 是什么
PG(ProGramer)指程序员. 这类人才在企业中所占数量最多,通常占到整个项目员工数的70%,也是企业中最紧缺的一类职位,一般为具有专业知识的软件工程技术人员. PL(project leade ...
- asp.net大文件分块上传断点续传demo
IE的自带下载功能中没有断点续传功能,要实现断点续传功能,需要用到HTTP协议中鲜为人知的几个响应头和请求头. 一. 两个必要响应头Accept-Ranges.ETag 客户端每次提交下载请求时,服务 ...