ca-archived / iOS-NBUImagePicker

Modular image picker with Simulator-compatible AVFondation camera, assets library, filters and more.
http://cyberagent.github.io/iOS-NBUImagePicker
Apache License 2.0
193 stars 48 forks source link

Grey gradient background overlay app view after dismissing picker #13

Closed DanH-SyncInteractive closed 9 years ago

DanH-SyncInteractive commented 9 years ago

I really love this picker but i'm having one issue that is a right pain.

iPhone 6 is 8.3

This happens on device and simulator.

Code:

NBUImagePickerOptions options = (
                                     NBUImagePickerOptionSingleImage |      // Single or multiple
                                     NBUImagePickerOptionReturnImages |     // Result Mode
                                     NBUImagePickerOptionStartWithPrompt |  // Start mode
                                     NBUImagePickerOptionDoNotSaveImages    // Save mode
                                     );
    [NBUImagePickerController startPickerWithTarget:self
                                            options:options
                                   customStoryboard:nil
                                        resultBlock:^(NSArray *imagesArray)
     {
         DebugLog(@"Count: %d", (int)imagesArray.count);
     }];

Steps to recreate:

  1. Launch Picker, choose "Take a picture"
  2. Press the Cancel button top left.
  3. Picker dismisses, gradient overlay instantly added over top of screen. See screenshot.

ios simulator screen shot 17 jun 2015 11 27 20

This only happens on the "Take a picture" option. "Choose an image" seems to be fine.

Thanks

rivera-ernesto commented 9 years ago

The demo project as committed here doesn't seem have that problem. Updating CocoaPods (committed here with 0.35.0) and GPUImage to check again.

DanH-SyncInteractive commented 9 years ago

So I have: pod 'NBUImagePicker'

Which installs: Installing GPUImage (0.1.6) Installing Lockbox (2.1.0) Installing MotionOrientation@PTEz (1.1.0) Installing NBUCore (2.0.4) Installing NBUImagePicker (1.5.3) Installing NBUKit (2.4.1) Installing RBVolumeButtons@PTEz (0.1.1)

When I download the demo project and run it, the issue doesn't occur. But I can't work out whats causing it in my project.

As I said, the choose library is fine. Its just take a photo.

rivera-ernesto commented 9 years ago

I'm pretty sure it's particular to your project. I suggest you trying to find out where that gradient view comes from by inspecting it with Xcode's UI Hierarchy tool.

http://www.raywenderlich.com/98356/view-debugging-in-xcode-6

DanH-SyncInteractive commented 9 years ago

Okay thanks for the info.

For reference I worked out what was causing the issue, incase anyone else stumbles on the same problem.

Essentially I was adding a gradient background view to my window as per the following code. Removing this fixed the issue... hoorah!

UIView *bgView = [UIView new];
[bgView setFrame:self.window.bounds];
CAGradientLayer *lineGradientLayer = [CAGradientLayer layer];
lineGradientLayer.frame = bgView.bounds;
lineGradientLayer.colors = @[(id)[self.window.backgroundColor CGColor],
                             (id)[[UIColor colorWithHexString:@"#4E5C6A"] CGColor]];
lineGradientLayer.locations = @[@0.0, @1.0];
[bgView.layer insertSublayer:lineGradientLayer atIndex:0];
[self.window addSubview:bgView];
[self.window sendSubviewToBack:bgView];

Thanks for the quick replies Rivera.

rivera-ernesto commented 9 years ago

Good to hear that! Thanks