I cannot figure this out.
I have a view.
it is a speedometer.
I put a needle in the speedometer:
- (id) initWithFrame: (CGRect) frame
{
self = [super initWithFrame: frame]; // [super initWithCoder: coder];
if (! self)
return nil;
:
:
:
self.needle = [ [ [Needle alloc] initWithMaxRadius: 0.5*300
[self.layer addSublayer: needle.layer];
self.needle.layer.position = CGPointMake( frame.size.width / 2, frame.size.height / 2 );
return self;
}
The needle object contains a CALayer property.
the needle takes care of positioning itself for every frame -- it sets up its own display link handler and performs a transform on this layer
now suddenly my view's layoutSubviews method gets hit every frame.
I cannot understand this behaviour.
I can understand some change in the SUPERview causing this method to get hit. but how can a SUBlayer force this?
surely a sublayer should be at the mercy of its parent?
I tried setting
self.autoresizesSubviews = NO;
which obviously has no effect
the property I'm looking for would be
self.getsAutoresizedBySubviewsOrLayers = NO;
what is going on?