<TextView
android:             //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>

 

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

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

 

相关文章:

  • 2021-05-13
  • 2022-03-07
  • 2021-10-20
  • 2022-01-30
  • 2021-12-02
  • 2022-02-06
  • 2021-11-17
  • 2022-01-12
猜你喜欢
  • 2022-01-18
  • 2021-06-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案