68.TextView设置中划线、下划线

android:textAppearance
设置文字外观。如“?android:attr/textAppearanceLargeInverse
”这里引用的是系统自带的一个外观,?表示系统是否有这种外观,否则使用默认的外观。可设置的值如下:textAppearanceButton/textAppearanceInverse/textAppearanceLarge/textAppearanceLargeInverse/textAppearanceMedium/textAppearanceMediumInverse/textAppearanceSmall/textAppearanceSmallInverse

textView.getPaint().setFlags(Paint. UNDERLINE_TEXT_FLAG ); //下划线

textView.getPaint().setAntiAlias(true);//抗锯齿

textview.getPaint().setFlags(Paint. STRIKE_THRU_TEXT_FLAG); //中划线

setFlags(Paint. STRIKE_THRU_TEXT_FLAG|Paint.ANTI_ALIAS_FLAG);  // 设置中划线并加清晰 

textView.getPaint().setFlags(0);  // 取消设置的的划线


如题:






posted @ 2015-12-23 16:37  yutianran  阅读(1854)  评论(0编辑  收藏  举报