zoukankan      html  css  js  c++  java
  • One TextView More Style

    String w = "The quick fox jumps over the lazy dog";  
      
            int start = w.indexOf('q');  
      
            int end = w.indexOf('k') + 1;  
      
            Spannable word = new SpannableString(w);  
            word.setSpan(new AbsoluteSizeSpan(22), start, end,   
                    Spannable.SPAN_INCLUSIVE_INCLUSIVE); //字体大小
            word.setSpan(new StyleSpan(Typeface.BOLD), start, end,   
                    Spannable.SPAN_INCLUSIVE_INCLUSIVE);  //字体
            word.setSpan(new BackgroundColorSpan(Color.RED), start, end,   
                    Spannable.SPAN_INCLUSIVE_INCLUSIVE); //背景
            word.setSpan(new ForegroundColorSpan(Color.Blue), start, end,   
                   Spannable.SPAN_INCLUSIVE_INCLUSIVE);  //字体颜色
    
        
     word.setSpan(new StrikethroughSpan(), m.start(), m.end(),
              Spannable.SPAN_INCLUSIVE_INCLUSIVE);  //删除线
         word.setSpan(new URLSpan(w), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);//下划线
      
            textView.setText(word);    
    

      

  • 相关阅读:
    ubuntu安装pgAdmin 4
    python 读取文件
    byobu copy
    vim快捷键汇总
    python 停止线程
    python执行外部命令并获取输出
    gevent mysql
    python类型转换
    量化交易
    Java集合:HashMap底层实现和原理(源码解析)
  • 原文地址:https://www.cnblogs.com/gfqFighting/p/3810308.html
Copyright © 2011-2022 走看看