#01# 方法一:

            TextView textView = (TextView) view.findViewById(R.id.text);                        SpannableString ss = new SpannableString("北京欢迎你,荣昌挺好的");            ss.setSpan(new ForegroundColorSpan(Color.RED), 0, 7, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);            ss.setSpan(new ForegroundColorSpan(Color.GREEN), 7, 10, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);            textView.setText(ss);

#02# 方法二:

textView.setText(Html.fromHtml("<font size=\"3\" color=\"red\">北京欢迎你,荣昌挺好的</font><font size=\"3\" color=\"green\">,挺好的</font>"));

更多相关文章

  1. Android camera调用出现错误解决方法
  2. Android Studio实现Activity生命周期的7个方法Log打印日志信息
  3. Android UI编辑器 Unhandled event loop exception解决方法
  4. android 调用前摄像头进行拍照的方法及完整例子
  5. android包Android "java.lang.NoClassDefFoundError:*"报错的处
  6. android使用notifyDataSetChanged()方法,adapter的数据更新了,但是
  7. Win7 64位 Android SDK下载和更新失败的解决方法
  8. Android中 int 和 String 互相转换的多种方法

随机推荐

  1. 用shape美化控件
  2. 用Lazarus编译Android工程
  3. Android中的Context
  4. Android代码内存优化建议-Android资源篇
  5. Android(安卓)高手进阶教程(十四)之----A
  6. Android中几种图像特效处理的集锦!!
  7. 使用nginx配置android文档本地站点
  8. [Android]混淆代码后生成带签名的apk
  9. Android(安卓)最火快速开发框架AndroidAn
  10. [原创] 如何在android中实现swipe的手势