uipopovercontroller

How can I have a popover come from a tab instead of a view

北城余情 提交于 2019-11-28 10:30:56
问题 I have a tabbar app, and I want a popover to come from one of the tabs. Is there a good/easy way to do this without changing views? 回答1: There isn't currently a way to directly (through a supported api call) get the frame of a specific tab bar item. What I do is just show the popup from the left end of the tab bar like this: CGFloat tabBarHeight = self.tabBarController.tabBar.bounds.size.height; CGRect rect = CGRectMake(0, 0, tabBarHeight, tabBarHeight); [popoverController

Are there examples of how to use UIPopoverController on iOS?

依然范特西╮ 提交于 2019-11-28 09:34:21
I've seen some demos where UIPopoverController is used and would like to use it in my apps. So does anyone have any good tutorials that you could link me? Is it possible to use it in relation to UISegmentedControl where different popover windows are summoned when different segments are selected as a type of a switch view function? Nick Weaver Here are some tutorials: iPad for iPhone Developers 101: UIPopoverController Tutorial [iPad App Video] iPad App Tutorial – UIPopoverController Segmented Popover: Using a UISegmentedControl in the footer of UIPopoverController Buttons inside of a Pop Over

prepareForSegue is not called after performSegue:withIdentifier: with popover style

南楼画角 提交于 2019-11-28 06:35:38
I have a universal app, where I am sharing the same controller for a IPad and IPhone storyboard. I have put a UILongPressGestureRecognizer on a UITableView, that when a cell is pressed on iPhone it calls an action that perform a segue: -(IBAction)showDetail:(id)sender { UILongPressGestureRecognizer *gesture = (UILongPressGestureRecognizer*)sender; if (gesture.state == UIGestureRecognizerStateBegan) { CGPoint p = [gesture locationInView:self.theTableView]; NSIndexPath *indexPath = [self.theTableView indexPathForRowAtPoint:p]; if (indexPath != nil) { [self performSegueWithIdentifier:SEGUE_DETAIL

How to dismiss UIPopover from a button in the Popover

99封情书 提交于 2019-11-28 06:35:26
I am trying to dismiss a UIPopoverViewControler from a button in the Popover. In addition I want it to transfer the data back to the main view. I have it working for a modalViewController but not for a Popover. Does anyone know how I can achieve this? //popover - (IBAction) save:(id)sender { if ([self startDateIsValid] && [self endDateIsValid]) { [[self parentViewController] setDatesForEvent:startDate eventEndDate:endDate allDay:[allDaySwitch isOn]]; [self dismissModalViewControllerAnimated:YES]; } } //AddEventViewController_iPad #import <UIKit/UIKit.h> #import <Foundation/Foundation.h>

Remove border for UIPopoverController

人盡茶涼 提交于 2019-11-28 06:28:03
问题 I have a requirement where in I have to display a custom border for UIPopoverController's popover view instead of the default "Black theme" border. Is it possible? I cannot use the default black border because it doesnt suite the application's color theme. There is no provision in the SDK to do this. I have also googled to see if someone else have faced this problem and if they have solved it, but with no luck! Awaiting suggestions. Thanks, Raj 回答1: Solved this by using UIView and also by

iPad iOS7 - UIImagePickerController in UIPopoverController has wrong preview image

拥有回忆 提交于 2019-11-28 06:20:18
I am using an UIImagePickerController within an UIPopoverController which is working perfectly with iOS6. With iOS 7 the "preview" image which is shown to capture the image is rotated, but if I take a picture it is saved correctly. This is how I get my picker: UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.delegate = self; imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; imagePicker.mediaTypes = [NSArray arrayWithObjects: (NSString *) kUTTypeImage, nil]; imagePicker.allowsEditing = NO; And add it to a popover controller: self

Retain/release pattern for UIPopoverController, UIActionSheet, and modal view controllers?

南楼画角 提交于 2019-11-28 06:01:06
I'm somewhat unclear on the object ownership patterns required for the following instances. When my UIViewController presents a popover controller, an action sheet, or another view controller as modal, am I required to hang onto a retained reference to that child controller until it's been dismissed? In other words, do the following lines of code effectively "transfer" ownership, or not? [aPopoverController presentPopoverFromBarButtonItem:someButtonItem permittedArrowDirections:UIPopoverArrowDirectionAny animated:NO]; [anActionSheet showFromBarButtonItem:someButtonItem animated:NO];

ios13 UIPopoverViewController showing UITableViewController - Safe Area problems / Missing parts of table

。_饼干妹妹 提交于 2019-11-28 04:53:39
问题 In the same theme as this post: iOS 13 - UIPopoverPresentationController sourceview content visible in the arrow I have a UITableViewController instantiated from the Storyboard. I'm presenting it in a UIPopoverViewController. Depending on orientation I either have a side missing or the top missing and the content of the _UITableViewHeaderFooterViewBackground scrolls 'through' the arrow. What's wrong: These are when it's on the top, but if it presents on the side then the whole side EDIT: I AM

UIPopover without any arrows

泄露秘密 提交于 2019-11-28 04:38:16
Is it possible to present a popover without any sort of arrows pointing somewhere? Yes it is possible just do: [self.popoverController presentPopoverFromBarButtonItem:anItem permittedArrowDirections:0 animated:YES]; The zero represent no direction. For iPhone and swift 2.0 try this one Code to initiate popover initiatePopover(){ let popoverContent = self.storyboard?.instantiateViewControllerWithIdentifier("XYZController") as! XYZController let nav = UINavigationController(rootViewController: popoverContent) nav.modalPresentationStyle = UIModalPresentationStyle.Popover let popover = nav

How can I get the selected text frame from a UITextView

旧城冷巷雨未停 提交于 2019-11-28 04:25:54
I'm trying to display an UIPopoverController from the rect of a selected text in an UITextView , How can I get the selected text CGRect ? Thanks! barley I think [UITextInput selectedTextRange] and [UITextInput caretRectForPosition:] is what you are looking for. [UITextInput selectedTextRange] returns the selected range in character [UITextInput caretRectForPosition:] returns the CGRect of the character range in this input. UITextView conforms to UITextInput (since iOS 5), so you can use these methods for your UITextView instance. It is going to be something like this. UITextRange *