Android knowledge point textView plus line attributes:
For example, prices are underlined and underlined
- Line the bottom
Textview mTextView; mTextView = findViewById(R.id.tv); mTextView.getPaint().setFlags(Paint. UNDERLINE_TEXT_FLAG); // The font of this property is a bit blurred.Copy the code
- The line in the middle is:
mTextView.getPaint().setFlags(Paint. STRIKE_THRU_TEXT_FLAG); // The font of this property is a bit blurred.Copy the code
We found that the font on both of these images has a blur effect and we can get rid of the blur effect by saying "paint.anti_alias_flag"
Textview.getpaint ().setflags (paint.anti_alias_flag); / / can be combined together to write for: mTextView getPaint () setFlags (Paint. STRIKE_THRU_TEXT_FLAG | Paint. ANTI_ALIAS_FLAG);Copy the code
- The effect is shown below:
- Remove the marking
mTextView.getPaint().setFlags(0); // Cancel the underlineCopy the code
- anti-aliasing
mTextView.getPaint().setAntiAlias(true); / / anti-aliasingCopy the code
Share with you
I want to work my way up
Fly forward on the blades at the highest point
Let the wind blow dry tears and sweat
I want to work my way up
Waiting for the sun to watch its face
Little days have big dreams
I have my day
Let the wind blow dry tears and sweat
One day I will have my day