当前位置:   article > 正文

Android :textview文字加粗、下划线、倾斜_textview 下划线

textview 下划线

Android : textview text bold, underlined, slanted

TextView textView = findViewById(R.id.text_view);
textView.setTypeface(null, Typeface.BOLD);


TextView textView = findViewById(R.id.textView);

// Set the text to be bold, underlined, and slanted
textView.setTypeface(textView.getTypeface(), Typeface.BOLD_ITALIC | Typeface.UNDERLINE);

// Alternatively, you can set each style separately
// textView.setTypeface(textView.getTypeface(), Typeface.BOLD);
// textView.setPaintFlags(textView.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
// textView.setTypeface(Typeface.create(textView.getTypeface(), Typeface.ITALIC));


// Get the TextView instance
TextView textView = findViewById(R.id.textView);

// Add underline
textView.setPaintFlags(textView.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);

// Remove underline
textView.setPaintFlags(textView.getPaintFlags() & (~Paint.UNDERLINE_TEXT_FLAG));

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/648005
推荐阅读
相关标签
  

闽ICP备14008679号