<TextView
android:id="@+id/tv"             //id号,指明这个TextView的唯一身份

android:autoLink="phone|web"    //电话或者网站的超链接,在字体里由电话号码的话,就会有有链接,有网址也会有超链接
android:layout_width="fill_parent"            
android:layout_height="wrap_content"
android:textSize="20sp"            //字体大小的设置
android:textColor="#00ff00"    //字体颜色的设置
android:text="@string/hello" />         //跳转到string.xml--》hello中,显示字体菜单及字体内容

<string name="hello">Hello World, https://www.taobao.com!</string>

    <string name="app_name">HelloWorld</string>

在主函数中也可以这样显示字体,在oncreate()函数下添加以下语句

TextView tv=(TextView)findViewById(R.id.tv);
tv.setText(Html.fromHtml("欢迎大家收看<font color = red>《Android开发从零开始》</font>系列课程。感谢大家的支持"));

Android之TextView控件的学习的更多相关文章

  1. 注意Android里TextView控件的一个小坑,用android:theme来设置样式时动态载入的layout会丢失该样式

    注意Android里TextView控件的一个小坑,用android:theme来设置样式时动态载入的layout会丢失该样式 这个坑,必须要注意呀, 比如在用ListView的时候,如果在List_ ...

  2. android中的TextView控件

    我以前是搞ssh开发的,现在在搞android开发,所以简单学习了一下,对于自己所了解的做一个记录,也算是一个笔记吧,如果有什么不对的,希望大家给予一定的指导.  一.TextView的基本使用 Te ...

  3. 五、Android学习第四天补充——Android的常用控件(转)

    (转自:http://wenku.baidu.com/view/af39b3164431b90d6c85c72f.html) 五.Android学习第四天补充——Android的常用控件 熟悉常用的A ...

  4. Android Material Design控件学习(三)——使用TextInputLayout实现酷市场登录效果

    前言 前两次,我们学习了 Android Material Design控件学习(一)--TabLayout的用法 Android Material Design控件学习(二)--Navigation ...

  5. android课程第一节(TextView控件使用)

    TextView控件使用 一.TextView基本使用(创建方式) 1.在程序中创建TextView对象 如下代码: @Override protected void onCreate(Bundle ...

  6. android软件开发之TextView控件常用属性

    TextView控件 text属性,设置显示的文本 textColor:设置文本颜色 textSize:设置文本字体大小 autoLink:设置文本为电话,URL连接等的时候是否显示为可点击的链接 c ...

  7. Android 中常见控件的介绍和使用

    1 TextView文本框 1.1 TextView类的结构 TextView 是用于显示字符串的组件,对于用户来说就是屏幕中一块用于显示文本的区域.TextView类的层次关系如下: java.la ...

  8. [转 载] android 谷歌 新控件(约束控件 )ConstraintLayout 扁平化布局

    序 在Google IO大会中不仅仅带来了Android Studio 2.2预览版,同时带给我们一个依赖约束的库. 简单来说,她是相对布局的升级版本,但是区别与相对布局更加强调约束.何为约束,即控件 ...

  9. 【转】Android M新控件之AppBarLayout,NavigationView,CoordinatorLayout,CollapsingToolbarLayout的使用

    Android M新控件之AppBarLayout,NavigationView,CoordinatorLayout,CollapsingToolbarLayout的使用 分类: Android UI ...

随机推荐

  1. Windows server 2008搭建php运行环境

    下载php组件包 首先到http://windows.php.net/download/下载你需要的php版本,这里我下载的是php5.3. 下面解压php组件 包到磁盘上. 安装Microsoft ...

  2. apt-get 总结

    转自: apt-get 总结 1.apt-get install <package_name> install a new package. 2.apt-get build-dep < ...

  3. Codeforces 237C

    题目: Description You've decided to carry out a survey in the theory of prime numbers. Let us remind y ...

  4. Masonry使用详解

    mas_makeConstraints 只负责新增约束 Autolayout不能同时存在两条针对于同一对象的约束 否则会报错 mas_updateConstraints 针对上面的情况 会更新在blo ...

  5. wl18xx module crash with "wlcore: ERROR ELP wakeup timeout!"

    [ 111.322967] wlcore: ERROR ELP wakeup timeout![ 111.327636] ------------[ cut here ]------------[ 1 ...

  6. 通知传值 notification

    @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; self.textF = [[UITextField ...

  7. 用GeneratedKeyHolder获得新建数据主键值

    public User createUser(final User user) { final String sql = "insert into sys_users(username, p ...

  8. Ztree当节点没有下级时不显示下拉图标

    select o.*,(select count(*) from sys_org t where t.orgsupid=o.orgid) isLeaf from sys_org o where 1=1

  9. Hibernate 系列教程5-双向多对一

    主要讲解inverse和cascade的用法 cascade定义的是关系两端对象到对象的级联关系: 而inverse定义的是关系和对象的级联关系(管理外键的值). inverse 属性默认是false ...

  10. HDU1258 Sum it up

    Sum it up 题意:给定一个数sum,和n个数,求sum可以由这n个数里面的那几个数的和表示. Given a specified total t and a list of n integer ...