0

回転しようとしていますUILabelが、回転後に境界線が歪んでジグザグに見えます。見栄えがよくないので、ラベルに境界線が必要です。次のコードを使用して回転させています。

[UIView beginAnimations:nil context:NULL]; // arguments are optional
lblText.transform = CGAffineTransformMakeRotation(angle);
[UIView commitAnimations];

境界線を滑らかにするにはどうすればよいですか?

4

2 に答える 2

1

You can add a 3 pixel transparent border to the inner view and rasterize it so that the pixels interpolate smoothing the border.

view.layer.borderWidth = 3; 
view.layer.borderColor = [UIColor clearColor].CGColor; 
view.layer.shouldRasterize = YES; 

Now the final trick is to add some shadow. This will make the border look somehow more solid.

view.layer.shadowOffset = CGSizeMake(0, -1); 
view.layer.shadowOpacity = 1; 
view.layer.shadowColor = [UIColor blackColor].CGColor

Don't forget to add QuartzCore Framework.

于 2012-11-22T08:39:19.430 に答える
1

Try this:

lblText.layer.allowsEdgeAntialiasing = YES;
于 2014-10-23T12:24:07.003 に答える