0

I have a view which has a few subviews. I am using transforms to scale the view 400%, which works perfectly, but I am not sure how to scale the "drawing" of the sub-views. So when I render the scaled view the subviews come out fuzzy because their drawing is still at 100%.

I have tried [view setNeedsDisplay] on the view and its subViews, but the drawing is still low resolution.

Any ideas on how to fix this render?

4

1 回答 1

1

尝试:

CGFloat myScale = 4.0;
[view setContentScaleFactor:myScale*[[UIScreen mainScreen] scale]]];

此外,如果您将视图嵌入到 UIScrollView 中以允许用户放大/缩小,则可以将此实现放在 UIScrollViewDelegate 中:

- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale {
    scale *= [[[scrollView window] screen] scale];
    [view setContentScaleFactor:scale];
}
于 2013-05-21T08:39:14.927 回答