Android笔记:TextView
作者:互联网
文字大小、颜色 textSize,textColor
显示不下使用... ellipsize(end)
文字+icon drawable
中划线、下划线
package com.example.demo; import androidx.appcompat.app.AppCompatActivity; import android.graphics.Paint; import android.os.Bundle; import android.widget.TextView; public class textviewActivity extends AppCompatActivity { private TextView mTv4; private TextView mTv5; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_textview); mTv4=(TextView)findViewById(R.id.tv_4); mTv5=(TextView)findViewById(R.id.tv_5); mTv4.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);//中划线 mTv4.getPaint().setAntiAlias(true);//去锯齿 mTv5.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);//下划线 } }
标签:笔记,Paint,getPaint,import,Android,mTv5,mTv4,TextView 来源: https://www.cnblogs.com/zlyyds/p/15760130.html