How do I achieve a clearly rendered rotated UILabel?

后端 未结 1 1483
情话喂你
情话喂你 2021-01-26 13:52

I am trying to display rotated text. The UILabel is added as a subview on a UIImageView. The UIImageView has a transform created via say CGAffineTransformMakeRotation(M_PI/4.0).

1条回答
  •  隐瞒了意图╮
    2021-01-26 14:11

    The problem is that your label is rendered in half pixel either in the origin of the frame or the rotation. Check the frame origin after rotation, or try to rotate it by M_PI/4.1 (4.2, 4.3, 4.4, 4.5 - even test values like 4.05 4.15..) until it renders normally. Also check the frame of the UILabel in the UIImageView, could be added at half pixel origin for ex. {0.5, 0.5} or something..

    0 讨论(0)
提交回复
热议问题