textview基本使用:

<TextView
10. android:id="@+id/txtOne"
11. android:layout_width="200dp"
12. android:layout_height="200dp"
13. android:gravity="center"//设置该控件中内容的对齐方式,注意区别layout_gravity
14. android:text="TextView(显示框)"
15. android:textColor="#EA5246"
16. android:textStyle="bold|italic"//设置字体风格
17. android:background="#000000"
18. android:textSize="18sp" />
19.

进阶1:

带阴影的textview:

<TextView
2. android:layout_width="wrap_content"
3. android:layout_height="wrap_content"
4. android:layout_centerInParent="true"
5. android:shadowColor="#F9F900"//设置阴影颜色
6. android:shadowDx="10.0"//水平偏移的位移
7. android:shadowDy="10.0"//竖直
8. android:shadowRadius="3.0"//甚至阴影的模糊程度
9. android:text="带阴影的TextView"
10. android:textColor="#4A4AFF"
11. android:textSize="30sp" />

进阶2:

带边框的textview:

先画一个drawable然后背景设为这个就行了
矩形边框
1.<?xml version="1.0" encoding="utf-8"?>
2.<shape xmlns:android="http://schemas.android.com/apk/res/android" >
3.
4. <!-- 设置一个黑色边框 -->
5. <stroke android:width="2px" android:color="#000000"/>
6. <!-- 渐变 -->
7. <gradient
8. android:angle="270"
9. android:endColor="#C0C0C0"
10. android:startColor="#FCD209" />
11. <!-- 设置一下边距,让空间大一点 -->
12. <padding
13. android:left="5dp"
14. android:top="5dp"
15. android:right="5dp"
16. android:bottom="5dp"/>
17.
18.</shape>
圆形边框
<?xml version="1.0" encoding="utf-8"?>
2.<shape xmlns:android="http://schemas.android.com/apk/res/android">
3.
4. <!-- 设置透明背景色 -->
5. <solid android:color="#87CEEB" />
6.
7. <!-- 设置一个黑色边框 -->
8. <stroke
9. android:width="2px"
10. android:color="#000000" />
11. <!-- 设置四个圆角的半径 -->
12. <corners
13. android:bottomLeftRadius="10px"
14. android:bottomRightRadius="10px"
15. android:topLeftRadius="10px"
16. android:topRightRadius="10px" />
17. <!-- 设置一下边距,让空间大一点 -->
18. <padding
19. android:bottom="5dp"
20. android:left="5dp"
21. android:right="5dp"
22. android:top="5dp" />
23.
24.</shape>

进阶3:

带图片的textview

7.     <TextView
8. android:layout_width="wrap_content"
9. android:layout_height="wrap_content"
10. android:layout_centerInParent="true"
11. android:drawableTop="@drawable/show1" //设置文字上方的图片
12. android:drawableLeft="@drawable/show1"
13. android:drawableRight="@drawable/show1"
14. android:drawableBottom="@drawable/show1"
15. android:drawablePadding="10dp" //设置文字与图片的距离
16. android:text="微信" />
17.

4:

使用autoLink属性识别链接类型

<TextView
....
andorid:text="www.baidu.com"
android:autolink="email/phone/map/...."
/>

android 界面控件 textview 全解的更多相关文章

  1. Android列表控件ListView详解

    ListView绝对可以称得上是Android中最常用的控件之一,几乎所有应用程序都会用到它. 由于手机屏幕空间都比较有限,能够一次性在屏幕上显示的内容并不多,当我们的程序中有大量的数据需要展示的时候 ...

  2. Android 基础控件 TextView

    一TextView介绍: TextView是UI最基本的组件,使用TextView可以显示丰富的文本信息.设置添加TextView最常见的方法就是在xml中添加TextView元素,并指定属性.Tex ...

  3. Android常见控件— — —TextView

    <?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android=&qu ...

  4. Android基础控件TextView

    1.常用属性 <TextView android:id="@+id/text11" //组件id android:layout_width="match_paren ...

  5. Android开发CheckBox控件,全选,反选,取消全选

    在Android开发中我们经常会使用CheckBox控件,那么怎么实现CheckBox控件的全选,反选呢 首先布局我们的界面: <?xml version="1.0" enc ...

  6. Android开发之基本控件和详解四种布局方式

    Android中的控件的使用方式和iOS中控件的使用方式基本相同,都是事件驱动.给控件添加事件也有接口回调和委托代理的方式.今天这篇博客就总结一下Android中常用的基本控件以及布局方式.说到布局方 ...

  7. Android 开源控件与常用开发框架开发工具类

    Android的加载动画AVLoadingIndicatorView 项目地址: https://github.com/81813780/AVLoadingIndicatorView 首先,在 bui ...

  8. Android基本控件之Menus

    在我们的手机中有很多样式的菜单,比如:我们的短信界面,每条短信,我们长按都会出现一个菜单,还有很多的种类.那么现在,我们就来详细的讨论一下安卓中的菜单 Android的控件中就有这么一个,叫做Menu ...

  9. Android基本控件和事件以及消息总结

    Android学生空间界面设计涉及到的常用基本控件有TextView,EditText,Button,ImageView,CheckBox,RadioButton,基本事件有触屏和键盘事件,包括onT ...

随机推荐

  1. 开源TSDB简介--Druid

    开源TSDB简介--Druid Druid是一个以Java编写的开源分布式列式数据存储. Druid的目标是快速提取大量事件数据,并提供低延迟的查询. 德鲁伊的名字来源于许多角色扮演游戏中的变形德鲁伊 ...

  2. mysql中时间日期函数

    转自:mysql 中 时间和日期函数 一.MySQL 获得当前日期时间 函数 1.1 获得当前日期+时间(date + time)函数:now() mysql> select now(); +- ...

  3. js消息提示框插件-----toastr用法

     (本文系转载) 因为个人项目中有一个提交表单成功弹出框的需求,从网上找了一些资料,发现toastr这个插件的样式还是不错的.所以也给大家推荐下,但是网上的使用资料不是很详细,所以整理了一下,希望能给 ...

  4. SpringSecurity 3.2入门(3)单用户登录

    1.增加web.xml文件配置如下 <!-- 获取Spring Security session的生命周期,这个监听器会在 session 创建和销毁的时候通知 Spring Security ...

  5. 了解WaitForSingleObject中WAIT_ABANDONED 返回值

    1.互斥量内核对象 互斥量内核对象用来确保一个线程独占对一个资源的访问.互斥量对象包含一个使用计数.线程ID以及递归计数.互斥量与关键段的行为完全相同.但是互斥量是内核对象,而关键段是用户模式下的同步 ...

  6. mysql四-1:单表查询

    一.单表查询的语法 SELECT 字段1,字段2... FROM 表名 WHERE 条件 GROUP BY field HAVING 筛选 ORDER BY field LIMIT 限制条数 二.关键 ...

  7. 统计学中的P值与显著性的意义

    统计学意义(p值) 结果的统计学意义是结果真实程度(能够代表总体)的一种估计方法.专业上,p值为结果可信程度的一个递减指标,p值越大,我们越不能认为样本中变量的关联是总体中各变量关联的可靠指标.p值是 ...

  8. 转:什么是4D(DRG、DLG、DOM、DEM)数据?

    ps:摘抄地址http://blog.163.com/wangqing_rs/blog/static/16451519120111026102916472/  什么是4D(DRG.DLG.DOM.DE ...

  9. keychains

    keychain在ios中是保存在sqlite数据库中的.这个数据库文件的位置:真机:/private/var/Keychains/keychain-2.db虚拟机:/Users/USER-HOME/ ...

  10. jdk时区相差8小时

    设置JVM的默认时区为东八区(北京时间)在下面四个目录(jre6\lib\zi\Etc.jre6\lib\zi.jdk1.6.0_18\jre\lib\zi\Etc.jdk1.6.0_18\jre\l ...