Domanda

I have a UIViewController with some buttons that works fine when I add as subview, but when I present this viewcontroller in UIPopoverController none of the buttons trigger actions. Someone knows that problem ?

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"iPhoneStoryboard" bundle:nil];
menuViewController =  (MenuListViewController *)[storyboard instantiateViewControllerWithIdentifier:@"menuviewcontroller"];

Buttons inside viewcontroller works if I use:

[self.view menuViewController.view];

But I want to use

popover = [[UIPopoverController alloc]initWithContentViewController:menuViewController];
È stato utile?

Soluzione

One thing to look at when you can't interact with UI elements, especially after frame resizes, is to check that your elements are not outside of their parents bounds, check my answer to this question

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top