posts - 93,  comments - 2,  trackbacks - 0


          String string="

          歡迎你來到的

          jack

          android

          使用技術總結

          "; 

           

           

           

           

           

           

           

           

          TextV

          iew info2=(TextView)super.findV

          iewById(R.id.info); 

           

           

           

           

           

           

           

           

          SpannableStringBuilder 

          span=new 

          SpannableStringBuilder(string);--

          獲取一個填充顏

          色的對象

          -- 

           

           

           

           

           

           

           

           

          span.setSpan(new ForegroundColorSpan(

          Color.RED),-- 

          指定從

          6

          9

          之間的字符串顯示為紅色

          .. 

           

          6, 9,Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);--

          指定具體字符串位置顯示對應的顏色

          --

           

           

           

           

           

           

           

           

           

          info2.setText(span);--

          添加到文本顯示中

          ..


          String string="

          歡迎你來到的

          jack

          android

          使用技術總結

          "; 

           

           

           

           

           

           

           

           

          TextV

          iew info2=(TextView)super.findV

          iewById(R.id.info); 

           

           

           

           

           

           

           

           

          SpannableStringBuilder 

          span=new 

          SpannableStringBuilder(string);--

          獲取一個填充顏

          色的對象

          -- 

           

           

           

           

           

           

           

           

          span.setSpan(new ForegroundColorSpan(

          Color.RED),-- 

          指定從

          6

          9

          之間的字符串顯示為紅色

          .. 

           

          6, 9,Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);--

          指定具體字符串位置顯示對應的顏色

          --

           

           

           

           

           

           

           

           

           

          info2.setText(span);--

          添加到文本顯示中

          ..

          String string="歡迎你來到的jack的android使用技術總結";         
            TextView info2=(TextView)rootView.findViewById(R.id.info);         
            SpannableStringBuilder span=new SpannableStringBuilder(string); //獲取一個填充顏色對象        
            span.setSpan(new ForegroundColorSpan(Color.RED), 6, 9,Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
            info2.setText(span);
          posted on 2015-06-15 14:21 Terry Zou 閱讀(228) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          <2015年6月>
          31123456
          78910111213
          14151617181920
          21222324252627
          2829301234
          567891011

          常用鏈接

          留言簿(2)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          相冊

          收藏夾

          Java

          搜索

          •  

          最新隨筆

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 宁陕县| 信丰县| 霍山县| 柳江县| 彝良县| 建瓯市| 邹城市| 义乌市| 焦作市| 筠连县| 射阳县| 资中县| 易门县| 布尔津县| 韶山市| 湘潭市| 贵德县| 集贤县| 丰镇市| 新疆| 长治市| 泽普县| 延川县| 莱西市| 繁峙县| 通州区| 新兴县| 乌审旗| 黔西县| 伊金霍洛旗| 高碑店市| 望城县| 曲麻莱县| 始兴县| 奎屯市| 榆社县| 连云港市| 卫辉市| 沙雅县| 安平县| 赞皇县|