hayashi311 / Color-Picker-for-iOS

Colorful: iOS color picker built with Swift.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

colorMapView does not follow orientation changes

skuske opened this issue · comments

commented

When changing from portrait to landscape, colorMapView remains in it's portrait layout. Any fix for that?

Thanks.

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.