I have a multi-line UILabel
that I want to enable zooming on.
I embedded it with a UIScrollView
and set min zoom to .25 and max zoom to 4.
I tested JEzu's code in iOS 5.1 and 6 beta, it is working for a const text label, but cause other normal label require updating text content fail, i.e. the text is not changed...
I subclass the UILabel as ZoomableLabel with JEzu's answer, and apply the class as the label's custom class and it works fine.
I implemented Scrimmers's solution by subclassing UILabel as DetailedUILabel with overriding methods like this;
import QuartzCore
#import <QuartzCore/QuartzCore.h>
override init method, initWithFrame whichever you want.
- (id)init
{
self = [super init];
if (self) {
CATiledLayer *tiledLayer = (CATiledLayer *)self.layer;
tiledLayer.levelsOfDetailBias = 4;
tiledLayer.levelsOfDetail = 4;
self.opaque = YES;
}
return self;
}
and layerClass, class method.
+ (Class)layerClass {
return [CATiledLayer class];
}