开发者

Zooming disturbing drawn UIImage in UIView

开发者 https://www.devze.com 2023-01-25 06:29 出处:网络
I have UIView in which I am drawing UIImage - (void)drawRect:(CGRect)rect { [myImage drawInRect:rect]; } This UIView is added on UIScrollView and returned as zoomable view i.e

I have UIView in which I am drawing UIImage

- (void)drawRect:(CGRect)rect
{
    [myImage drawInRect:rect];
}

This UIView is added on UIScrollView and returned as zoomable view i.e

- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{   
    return iImageBgView;
}

Problem is coming when I do the zoom. Image which is drawn is getting shown pixelet i.e blur or disturbed. can anyone help me on "How to refresh / redraw this image"

I am manually refreshing / redrawing the image by calling

[self setNeedsDisplay];

but no use. seems like it is taking the previous coordinate and draw as per that i开发者_如何学JAVAnstead of updated coordinate.

Thanks,

Sagar


This issue has been resolved by removing this UIView and adding it again on scrollview.

This has been done on

- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale
{
   // Remove Imageview and add to Scrollview again
}
0

精彩评论

暂无评论...
验证码 换一张
取 消