我是靠谱客的博主 动人樱桃,这篇文章主要介绍android字体带下划线,现在分享给大家,希望可以做个参考。

界面布局文件代码:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:gravity="center"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <TextView
        android:id="@+id/tv"
        android:textSize="64sp"
        android:text="hello"
        android:textStyle="bold"
        android:textColor="#000000"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</LinearLayout>

java代码:

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        init();
    }

    private void init() {
        TextView tv = (TextView)findViewById(R.id.tv);
        tv.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG );
    }
}

效果:


最后

以上就是动人樱桃最近收集整理的关于android字体带下划线的全部内容,更多相关android字体带下划线内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(108)

评论列表共有 0 条评论

立即
投稿
返回
顶部