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的更多相关文章

  1. DevExpress 为TextEdit设置水印文字

    设置水印代码: //设置水印值public static void SetWatermark(this TextEdit textEdit, string watermark) { textEdit. ...

  2. DevExpress实现为TextEdit设置水印文字

    本文实例展示了DevExpress实现为TextEdit设置水印文字的方法,是一个很实用的技巧.分享给大家供大家参考. 转自 http://blog.csdn.net/yh0503/article/d ...

  3. TextEdit 回车事件

    <dxe:TextEdit Name="txtSearchPatientName" KeyDown="txtSearchPatientName_KeyDown_1& ...

  4. QML之TextEdit

    TextEdit显示一个可编辑的,有格式的文本框.它也可以显示明文和富文本.例如:TextEdit {    width: 240    text: "<b>Hello</ ...

  5. QML学习:Rectangle,Text,TextEdit,Flickable,Flipable元素

    QML学习:Rectangle,Text,TextEdit,Flickable,Flipable元素 本文博客链接:http://blog.csdn.net/jdh99,作者:jdh,转载请注明. 参 ...

  6. QT中LineEdit、TextEdit 、PlainTextEdit 三个控件的区别

    QLineEdit是单行文本输入,一般用于用户名.密码等少量文本交互地方.QTextEdit用于多行文本,也可以显示HTML格式文本.QPlainTextEdit与QTextEdit很像,但它多用于需 ...

  7. DevExpress.XtraEditors.TextEdit 设为密码输入框

    DevExpress.XtraEditors.TextEdit 设为密码输入框,解决办法: 设计窗口-->属性Properties-->Mask节点-->PasswordChar输入 ...

  8. 新手使用mac上的textedit写HTML时遇到的问题及解决办法

    刚开始在mac上学习HTML,总结一下遇到的问题和解决办法 问题:使用textedit编写html,在网页上却仍然显示的是代码. 解决办法: 打开textedit后打开文本编辑 选择偏好设置 按如图所 ...

  9. Dev TextEdit 输入提示

    TextEdit.Properties.NullValuePromptShowForEmptyValue = true; TextEdit.Properties.NullValuePrompt = “ ...

  10. Dev的TextEdit控件IP地址的Mask设置

    1. 添加TextEdit控件. 2. 选中TextEdit控件,查看控件属性. 3. 展开Properties属性项,找到Mask属性项. 4. 设置Mask属性项的EditMask属性值为:(25 ...

随机推荐

  1. sqlite3入门之sqlite3_get_table,sqlite3_free_table

    sqlite3_get_table sqlite3_get_table函数原型: int sqlite3_get_table( sqlite3 *db, /* An open database */ ...

  2. pandas速查手册(中文版)

    本文翻译自文章:Pandas Cheat Sheet - Python for Data Science 对于数据科学家,无论是数据分析还是数据挖掘来说,Pandas是一个非常重要的Python包.它 ...

  3. Handling skewed data---Error metrics for skewed(偏斜的) classes(precision&recall)

    skewed classes skewed classes: 一种类里面的数量远远高于(或低于)另一个类,即两个极端的情况. 预测cancer的分类模型,如果在test set上只有1%的分类误差的话 ...

  4. Vue 组件生命周期钩子

    Vue 组件生命周期钩子 # 1)一个组件从创建到销毁的整个过程,就称之为组件的生命周期 # 2)在组件创建到销毁的过程中,会出现众多关键的时间节点, 如: 组件要创建了.组件创建完毕了.组件数据渲染 ...

  5. Eclipse的tab键为4个空格完整方法 附:阿里代码开发规范书

    开发规范书:http://pan.baidu.com/s/1dESdyox 1.点击 window->preference-,依次选择 General->Editors->Text ...

  6. lstm-bp过程的手工源码实现

    近些年来,随着深度学习的崛起,RNN模型也变得非常热门.如果把RNN模型按照时间轴展开,它也类似其它的深度神经网络模型结构.因此,我们可以参照已有的方法训练RNN模型. 现在最流行的一种RNN模型是L ...

  7. Springboot打包及远程调试

    如果您使用Spring Boot Maven或Gradle插件来创建可执行jar,则可以使用来运行您的应用程序java -jar,如以下示例所示: $ java -jar target / myapp ...

  8. VS - ActionFilterAttribute

    Global.asax.cs public class MvcApplication : System.Web.HttpApplication { public static void Registe ...

  9. python3 结束子线程

    最近公司内部网络经常出问题,奇慢无比,导致人脸检测程序在下载图片时经常卡住,为了不影响数据的核对, 决定在网络不佳图片下载超时后放弃下载,继续执行后续程序. 于是整理出解决思路如下: 1.在线程中完成 ...

  10. Day12:H5

    掌握HTML+CSS+JavaScript相关知识 了解HTML5的结构标签: 掌握新增和删去的标签及相关属性 运用HTML5相关知识进行实际开发 下面哪种语法中是对大小写进行区分的? XHTML H ...