Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS11 -- When pushed onto a UINavigationController stack Done button is missing #193

Closed
kezzico opened this issue Sep 15, 2017 · 1 comment

Comments

@kezzico
Copy link

kezzico commented Sep 15, 2017

Here is the code to reproduce:

UIViewController *rootVc = ... ;
CLImageEditor *editor = [[CLImageEditor alloc] initWithImage:image];

[[UINavigationController alloc] initWithRootViewController:rootVc];

[self.navigationController setNavigationBarHidden:YES animated:NO];

[rootVc pushViewController: editor animated:YES];

CLImage Editor will unhide the navigation bar. However, the "Done" button will be missing. I tracked the issue down to line 97 in _CLImageEditorViewController. It looks like the way the navigation bar is being created causes a strange side effect.

I was able to bring the Done button back by commenting out 97 through 117 in _CLImageEditorViewController seen below.


    self.navigationItem.rightBarButtonItem = rightBarButtonItem;
    [self.navigationController setNavigationBarHidden:NO animated:NO];
    
    // if(_navigationBar==nil){
    //     UINavigationItem *navigationItem  = [[UINavigationItem alloc] init];
    //     navigationItem.leftBarButtonItem  = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(pushedCloseBtn:)];
    //     navigationItem.rightBarButtonItem = rightBarButtonItem;
        
    //     CGFloat dy = ([UIDevice iosVersion]<7) ? 0 : MIN([UIApplication sharedApplication].statusBarFrame.size.height, [UIApplication sharedApplication].statusBarFrame.size.width);
        
    //     UINavigationBar *navigationBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, dy, self.view.width, kNavBarHeight)];
    //     [navigationBar pushNavigationItem:navigationItem animated:NO];
    //     navigationBar.delegate = self;
        
    //     if(self.navigationController){
    //         [self.navigationController.view addSubview:navigationBar];
    //         [_CLImageEditorViewController setConstraintsLeading:@0 trailing:@0 top:@(dy) bottom:nil height:@(kNavBarHeight) width:nil parent:self.navigationController.view child:navigationBar peer:nil];
    //     }
    //     else{
    //         [self.view addSubview:navigationBar];
    //         [_CLImageEditorViewController setConstraintsLeading:@0 trailing:@0 top:@(dy) bottom:nil height:@(kNavBarHeight) width:nil parent:self.view child:navigationBar peer:nil];
    //     }
    //     _navigationBar = navigationBar;
    // }
    
    if(self.navigationController!=nil){

@yackle
Copy link
Owner

yackle commented Sep 16, 2017

Thanks for reporting, I'll look into this issue.

@yackle yackle closed this as completed in 9c6d21b Sep 20, 2017
sahara108 added a commit to sahara108/CLImageEditor that referenced this issue Dec 26, 2017
* 'master' of https://github.com/yackle/CLImageEditor:
  Update podspec
  fix yackle#196
  yackle#186 set status bar hidden
  fix yackle#197
  yackle#201 Added default alphabetical sorting to custom stickers
  Fix yackle#195
  Update podspec
  Fix yackle#193
  Adjust tone curve tool menu for iPhone X
  Adjust for iPhone X
  Use auto layout
  Add launch image
  Doesn't consider CIImage backed image
stansmida added a commit to percolate/CLImageEditor that referenced this issue Nov 5, 2019
… sync-upstream

* 'master' of https://github.com/yackle/CLImageEditor: (45 commits)
  Update podspec
  Use safeAreaLayoutGuide
  Add shared scheme
  Add project for Carthage
  Update podspec
  Fix warnings about implicity retaining self in block.
  yackle#206 Corrected sticker icon thumbnails content mode.
  Update podspec
  fix yackle#196
  yackle#186 set status bar hidden
  fix yackle#197
  yackle#201 Added default alphabetical sorting to custom stickers
  Fix yackle#195
  Update podspec
  Fix yackle#193
  Adjust tone curve tool menu for iPhone X
  Adjust for iPhone X
  Use auto layout
  Add launch image
  Doesn't consider CIImage backed image
  ...

# Conflicts:
#	CLImageEditor/CLImageEditor.bundle/Resources/en.lproj/Localizable.strings
#	CLImageEditor/CLImageEditorTheme.m
#	CLImageEditor/ImageTools/ToolSettings/CLToolbarMenuItem.m
#	CLImageEditor/ViewController/_CLImageEditorViewController.m
#	Demo/CLImageEditorDemo/CLImageEditorDemo/ViewController.m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants