i am using this following code to display a popover in my View
imagePopOver = [[UIPopoverController alloc];
initWithContentViewController:self.photoLibraryImageCollection.imagePickerController];
imagePopOver.popoverContentSize = CGSizeMake(185,675);
imagePopOver.delegate = self;
[imagePopOver presentPopoverFromRect:CGRectMake(600,0, 140, 800开发者_高级运维)
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];
it working fine however if we click any other part of myView ,this displayed popover is dismissing.can any one tell me how can i avoid this problem. i don't want to dismiss it at any time.can any one tell me how can do it.
In the popover's delegate (your viewController, probably), implement
- (BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)popoverController {
return NO;
}
Don't forget to set the delegate!
just wrote the below code at the time of popover initialization.
myPopOver.passthroughViews = [NSArray arrayWithObject:self.view];
in the above code will not dismiss your popOver and we can work with our View.
if you don't want to dismiss UIpopover only at the time of a textBox edit,simply write
myPopOver.passthroughViews = [NSArray arrayWithObject:self.textBox];
精彩评论