jacobsieradzki / JSImagePickerController

An photo/image picker controller that resembles the style of the image picker in iOS 8's messages app.
MIT License
224 stars 47 forks source link

Picker View Appears but all buttons and images are not able to be selected #5

Open PlasmaSoftUK opened 9 years ago

PlasmaSoftUK commented 9 years ago

Hello, I have implemented this in an App I am writing, and I can get the image picker to pop up at the bottom when I want it to. However I am unable to select any buttons or interact with it at all, its as if its disabled. please can you suggest how I might get around this?

If I find a fix in the mean time I will report back.

Kind Regards

Plasma

PlasmaSoftUK commented 9 years ago

Ok so I've fixed a little of it, if I open the Picker with ...

[imagePicker showImagePickerInController:self.view.window.rootViewController animated:YES];

instead of ..

[imagePicker showImagePickerInController:self animated:YES];

I can select an image from the top carousel, I still cannot select "Photo Library" or "Take Photo" from the menu. "Cancel" works, and when I press the other two buttons I see the colour change to reflect being pressed however nothing happens.

PlasmaSoftUK commented 9 years ago

I dug a little further and can now see this when trying to select the Library or Take Photo, still no idea how to fix this at the moment ...

2015-04-25 20:59:38.476 testApp[2505:72175] Library Selected 2015-04-25 20:59:38.661 testApp[2505:72175] Warning: Attempt to present <UIImagePickerController: 0x15089ba00> on <JSImagePickerViewController: 0x14fd562b0> whose view is not in the window hierarchy! 2015-04-25 20:59:47.914 testApp[2505:72175] Photo Selected 2015-04-25 20:59:47.972 testApp[2505:72175] Warning: Attempt to present <UIImagePickerController: 0x1500b1e00> on <JSImagePickerViewController: 0x14fd562b0> whose view is not in the window hierarchy!

PlasmaSoftUK commented 9 years ago

I've created a test app from scratch with the same view hierarchy as my main app. Same problem exists in this one too. I have uploaded the testApp to drop box ..

https://www.dropbox.com/s/1gyxlimlca9qoxq/testApp.zip?dl=0

Hopefully you can help me figure out whats wrong, happy to upload it to anywhere else if it helps.

jacobsieradzki commented 9 years ago

Hi, just read all your emails, I'll have a proper look at the code when I get home but could you just explain the navigation stack to me?

Eg. Navigation controller -> push VC -> modal presented -> image picker shown

Jake Sieradzki Sent from my iPhone

On 25 Apr 2015, at 10:25 pm, PlasmaSoftUK notifications@github.com wrote:

I've created a test app from scratch with the same view hierarchy as my main app. Same problem exists in this one too. I have uploaded the testApp to drop box ..

https://www.dropbox.com/s/1gyxlimlca9qoxq/testApp.zip?dl=0

Hopefully you can help me figure out whats wrong.

— Reply to this email directly or view it on GitHub.

PlasmaSoftUK commented 9 years ago
Thanks for the speedy response, the App setup (same as the one I put on drop box) is ..

One main Root UIViewController with an embedded TableView (no navigation controller)

Modal Segue from a Cell on that Table to a 2nd UIViewController which has a UIImage View on it.

This is where I call the picker from

jacobsieradzki commented 9 years ago

Just a quick guess from my phone and your emails, iOS is a bit fiddly when it comes to calling a modal segue from a modal segue (the image picker is the 2nd modal segue). Try calling the image picker from your initial view controller just temporarily for a test and see if your problems are fixed then.

On 25 Apr 2015, at 22:41, PlasmaSoftUK notifications@github.com wrote:

Jake, Thanks for the speedy response, the App setup (same as the one I put on drop box) is ..

One main Root UIViewController with an embedded TableView (no navigation controller)

Modal Segue from a Cell on that Table to a 2nd UIViewController which has a UIImage View on it.

This is where I call the picker from

Kind Regards

Kevin

On 25 Apr 2015, at 22:37, jacobsieradzki notifications@github.com wrote:

Hi, just read all your emails, I'll have a proper look at the code when I get home but could you just explain the navigation stack to me?

Eg. Navigation controller -> push VC -> modal presented -> image picker shown

Jake Sieradzki Sent from my iPhone

On 25 Apr 2015, at 10:25 pm, PlasmaSoftUK notifications@github.com wrote:

I've created a test app from scratch with the same view hierarchy as my main app. Same problem exists in this one too. I have uploaded the testApp to drop box ..

https://www.dropbox.com/s/1gyxlimlca9qoxq/testApp.zip?dl=0

Hopefully you can help me figure out whats wrong.

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/jacobsieradzki/JSImagePickerController/issues/5#issuecomment-96282724.

PlasmaSoftUK commented 9 years ago

Jake, Yes doing it from the first ViewController works just fine, so its definitely something to do with the ..

VC —> Modal VC —> Modal Picker View

Plasma

PlasmaSoftUK commented 9 years ago

Any news on this? Did you have chance to take a look?

Cheers Plasma

wanderingme commented 9 years ago

I'm having the same issue. All buttons unresponsive. I made a quick fix by adding the backgroundView and imagePickerView to the view instead of the window. Not sure if this'll cause other issues, but seems to work for now.

Change:

[self.window addSubview:self.backgroundView];
[self.window addSubview:self.imagePickerView];

To:

[self.view addSubview:self.backgroundView];
[self.view addSubview:self.imagePickerView];

Cheers.

PlasmaSoftUK commented 9 years ago

Unfortunately if I do that the menu doesn't show at all! :( I'd really like to find away to fix this.

PlasmaSoftUK commented 9 years ago

I take that back, changing "window" to "view" DID work, after I changed the way I present it back to just ..

[imagePicker showImagePickerInController:self animated:YES];

instead of the root view thing that I changed while trying to get it going......

[imagePicker showImagePickerInController:self.view.window.rootViewController animated:YES];

urtiaga commented 9 years ago

Great, that solve my problem too.