How to make the subview in a UIScrollView to refresh when we zoom it?
Posted
by wolverine
on Stack Overflow
See other posts from Stack Overflow
or by wolverine
Published on 2010-03-08T05:31:45Z
Indexed on
2010/03/08
5:36 UTC
Read the original article
Hit count: 545
I have subclassed UIView object inside a uiscrollview which displays a pdf page. I can zoom that page. But when I do so, the inside view is zoomed and is getting blurred. I understood that the inner view shud be refreshed and i called setNeedsDisplay. But no change have happened and its the same even now. Below is the code for drawRect for the subclassed uiview.
- (void)drawRect:(CGRect)rect
{
if(document)//the pdf document object
{
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextSaveGState(ctx);
CGContextTranslateCTM(ctx, 0.00, [self bounds].size.height);
NSLog(@"%f",[self bounds].size.height);
CGContextScaleCTM(ctx, 1.0, -1.0);
CGContextConcatCTM(ctx, CGPDFPageGetDrawingTransform(page, kCGPDFCropBox,
[self bounds], 0, true));
CGContextDrawPDFPage(ctx, page);
CGContextRestoreGState(ctx);
}
}
© Stack Overflow or respective owner