zoukankan      html  css  js  c++  java
  • android textview 下划线

    在xml文件中使用android:textStyle="bold" 可以将英文设置成粗体,但是不能将中文设置成粗体,将中文设置成粗体的方法是: 
    TextView tv = (TextView)findViewById(R.id.TextView01); 
    TextPaint tp = tv.getPaint(); 
    tp.setFakeBoldText(true); 
    其他还有: 
    textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 24f);//设置成24sp  
    textView.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));//可能中文加粗无效 
    textView.setTypeface(Typeface.defaultFromStyle(Typeface.ITALIC));//可能中文无效 
    textView.setText(Html.fromHtml("<u>"+texts+"</u>"));//下划线 
    textView.setTypeface(Typeface.MONOSPACE,Typeface.ITALIC);//斜体,中文有效 
    textView.getPaint().setFlags(Paint. STRIKE_THRU_TEXT_FLAG );//中间加横线 
    textView.getPaint().setFlags(Paint. UNDERLINE_TEXT_FLAG );//底部加横线

     

     

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

     

     

    http://www.cnblogs.com/umasuo/articles/android_TextView_underline.html

    http://www.eoeandroid.com/archiver/tid-7310.html?page=3

     
     
  • 相关阅读:
    ajax发送cookies
    关于几个入口
    关于.net的概念
    codeproject
    Chrome extension
    modern web application
    JavaScript类型转换
    js方法在iframe父子窗口
    javascript book
    MVC Controller
  • 原文地址:https://www.cnblogs.com/jiezzy/p/2762812.html
Copyright © 2011-2022 走看看