Recently, because the project needs to use an effect, that is, the display effect of TextView skew. After studying it, I found it very simple and shared it for use.
You can use it. If you have a picture, it's just the truth. First
In the upper-right corner of each item, a diagonal TextView is displayed!
First customize a TextView
Public class JZADScoreTextView extends TextView {public JZADScoreTextView (Context context) {super (context);} public JZADScoreTextView (Context context, AttributeSet attrs) {super (context, attrs );} @ Override protected void onDraw (Canvas canvas) {// slope 45, center between top, bottom, and left. canvas. rotate (45, getMeasuredWidth ()/3, getMeasuredHeight ()/3); super. onDraw (canvas );}} Yes, it's that simple.
There is a need for source code here to download http://download.csdn.net/detail/lan410812571/5786605 Download source code |