colorMapView does not follow orientation changes
skuske opened this issue · comments
SK commented
When changing from portrait to landscape, colorMapView remains in it's portrait layout. Any fix for that?
Thanks.
Toby Gall commented
In your HRColorMapView.m file, add [self createColorMapLayer];
to its layoutSubviews
method. Also update the start of your createColorMapLayer method with:
- (void)createColorMapLayer { if (self.colorMapLayer) { self.colorMapLayer.frame = (CGRect) {.origin = CGPointZero, .size = self.frame.size}; self.colorMapBackgroundLayer.frame = (CGRect) {.origin = CGPointZero, .size = self.frame.size}; return; }
This updates the image layers without creating new ones.