B-Sides / ELCImagePickerController

A clone of the UIImagePickerController using the Assets Library Framework allowing for multiple asset selection
http://www.icodeblog.com
1.65k stars 469 forks source link

IOS 11 not show Button "Done" #140

Open 0xhakawai opened 7 years ago

0xhakawai commented 7 years ago

simulator screen shot - iphone 6 - 2017-10-03 at 23 33 18

drosenstark commented 7 years ago

Weirder: for me this happens only on iPhone (not iPad)... looking into this now.

drosenstark commented 7 years ago

I'll have to actually do a fork and fix this, but for now, you can create this method in ELCAssetTablePicker

- (void) prepInstanceVariablesWithNavigationItem:(UINavigationItem *)item {
    if (self.immediateReturn) { return ; }
    UIBarButtonItem *doneButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(doneAction:)];
    [item setRightBarButtonItem:doneButtonItem];
    [item setTitle:NSLocalizedString(@"Loading...", nil)];
}

and then you need to call it from didSelectRowAtIndexPath in ELCAlbumPickerController.m

[picker prepInstanceVariablesWithNavigationItem:self.navigationItem];
stasian23 commented 6 years ago

but what about back button? how did you fix it?

sashakid commented 6 years ago

@drosenstark didn't find any fork in your account, so I've made it by myself as temp solution https://github.com/sashakid/ELCImagePickerController

WeiLiangTan commented 6 years ago

Have anyone found the root cause for this? It doesn't seems to be this image picker's problem. I tried adding 2 viewcontrollers and presenting it modally with a navigation controller and the same issue occurs

https://forums.developer.apple.com/thread/103854

WeiLiangTan commented 6 years ago

I'm not sure if my case is same as yours. I hope this would help.

In my project, my main navigation controller's view is a subview of the another ViewController with only one line of code [self.containerView addSubview:containedNavigationController.view];

As the containedNavigationController wasn't added as a child view controller, according to Apple's engineer, it breaks many of the connections needed for this to work properly.

So I was suggested to update the code to [containedNavigationController willMoveToParentViewController:self]; [self.containerView addSubview:containedNavigationController.view]; [self addChildViewController:containedNavigationController];

And this resolved the problem in my project.