每日总结 - Android TextView文字底部或者中间 加横线

tv = (TextView) this .findViewById(R.id. text_view ); 
中间加横线 
tv.getPaint().setFlags(Paint. STRIKE_THRU_TEXT_FLAG ); 
底部加横线: 
tv .getPaint().setFlags(Paint. UNDERLINE_TEXT_FLAG );

附:
TextVIew 的Html解析方法:
1 String htmlLinkText= " <a href=\\" +"<a href="http://www.baidu.com/><u">http://www.baidu.com/><u</a>>百度一下 </u></a>";        
2 tv.setText(Html.fromHtml(htmlLinkText)); 

 

posted @ 2014-10-06 11:00  冬叶's blog  阅读(1759)  评论(0编辑  收藏  举报