I looked around and it seems that people are saying that you can re-display the data after you zoom in now that you know the scaling factor for the UIScrollView. I also saw some posts on how to make your layer on CATiledLayer and set levelsOfDetailBias and levelsOfDetail.
I have a UIScrollView, and in it is ResultsView, which is a subclass of UIView:
- (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { CATiledLayer *tiledLayer = (CATiledLayer *)self.layer; tiledLayer.levelsOfDetailBias = 3; tiledLayer.levelsOfDetail = 3; self.opaque = YES; } return self; } + (Class)layerClass { return [CATiledLayer class]; }
In my class, where I have a UIScrollView and ResultsView, I do:
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView { return self.ResultsView; }
Is this enough for the text to be crossed out (harsh)? Or do I need to implement something in
- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx { }
If so, I'm not sure how to do this. In my class with UIScrollView and ResultsView, in ResultsView (in XIB), I just have several UILabels and UIViews (UIViews are used for headers / footers for presentation). Therefore, I do not know how to redraw them from ResultsView. Although ResultsView has UILabels and UIViews as their children in XIB, I'm not sure how to redraw them from the ResultsView class and what I need to do anyway.
Or is this the wrong approach? Do I just need to resize UILabel and UIView by scale factor in the scrollViewDidEndZooming: delegate method? TIA
source share