How to rotate TextView without clipping its bounds?

前端 未结 4 1904
南旧
南旧 2021-02-08 10:41

I\'m trying to rotate my subclass of TextView using canvas.rotate():

canvas.save();

final int w = getWidth();
final int h = getHeight(         


        
4条回答
  •  爱一瞬间的悲伤
    2021-02-08 10:57

    You could check out https://github.com/grantland/android-autofittextview Especially its refitText() method.

    Rotationg your Textview should after all result in the invocation of onMeasure() method, where all the magic begins.

提交回复
热议问题