uipopovercontroller

UIPopoverController placement

别来无恙 提交于 2019-12-01 14:41:11
I'm working on an app that is supposed to be universal, one app for both iPad and iPhone. I would like to keep their interfaces as similar as possible. In the iPhone app I am using a Tab bar controller, and one of those tabs goes to an image picker controller. Obviously I cannot do that in iPad. So I have hijacked control of that button to bring a popupcontroller that has the image picker in it. This all works well enough, except when I bring up the popup, it is not in the correct place. When I rotate the simulator, the popup goes to the correct place, and stays when I rotate back even. My

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

a 夏天 提交于 2019-12-01 11:31: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 using the Safe Area Guides: As I said previously, I dragged on from the object library a brand new

UIPopoverPresentationController on iPhone with iOS 10

女生的网名这么多〃 提交于 2019-12-01 09:58:20
I'm trying to display a ViewController as a popover on an iPhone. I have already been through several answers on SO and the rest of the web but none have worked so far. I wrote a simple app to test this. ViewController.swift: import UIKit class ViewController: UIViewController, UIPopoverPresentationControllerDelegate { override func viewDidLoad() { super.viewDidLoad() navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(clicked(_:))) } func clicked(_ sender: Any) { let vc = UIViewController() vc.view.backgroundColor = UIColor.blue vc

iOS: how to dismiss popovers [duplicate]

半腔热情 提交于 2019-12-01 09:21:21
Possible Duplicate: How to Dismiss a Storyboard Popover I have a iPad storyboard. A Bar Button Item in one View is Control-dragged to another view -- and a popover style is chosen. When I press the button the new popover view is shown in a popover, but I have two problems: When I press the button again, another instance of the popover view is displayed -- I can see, that the black border is getting darker and darker. If the popover view is open and I press the button, the popover view should dismiss. How can I do that? Currently the new popover view is floating to the button of the screen even

Popover's arrow to track an object in a scrollview

可紊 提交于 2019-12-01 08:16:02
问题 I show a popover whenever a cell in my tableview is touched, with the arrow pointing to the cell, and always pointing left or right, not up or down. The table view is set as the popover's passthroughView , so that the user can select a different cell while the popover is still open, resulting in a new popover for the selected cell. However, this means that the user can also scroll the table while the popover is open. When this happens, how can I make the popover's arrow continue to point at

How to do “actionSheet showFromRect” in iOS 8?

旧巷老猫 提交于 2019-12-01 07:39:29
In iOS 7, I show actionSheet by "showFromRect": [actionSheet showFromRect:rect inView:view animated:YES]; But in iOS 8, this doesn't work. They they replace the implementation and suggest us using UIAlertController. Then how do I show this actionSheet like a popover? Using UIAlertController you can access the popoverPresentationController property to set the sourceView (aka inView) and sourceRect (aka fromRect). This gives the same appearance as the previous showFromRect:inView: UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Title" message:@"message" preferredStyle

How to present keyboard inside popover?, ipad passcode lock style

和自甴很熟 提交于 2019-12-01 06:39:05
Is it posible to present a keyboard the way is shown when you set a passcode for your ipad? Unfortunately no, But what i did to replicate this was, built a bunch of buttons like a keyboard inside my passcode view using interface builder. Then linked each button to a command that would change the text field. - (IBAction) button9_clicked:(id) sender{ if ([self textField:theTextField shouldChangeCharactersInRange:range replacementString:@"9"]){ self.theTextField.text=[self.theTextField.text stringByAppendingString:@"9"]; range.location = self.theTextField.text.length; } else range.location = self

UIPopoverPresentationController on iPhone with iOS 10

早过忘川 提交于 2019-12-01 06:09:40
问题 I'm trying to display a ViewController as a popover on an iPhone. I have already been through several answers on SO and the rest of the web but none have worked so far. I wrote a simple app to test this. ViewController.swift: import UIKit class ViewController: UIViewController, UIPopoverPresentationControllerDelegate { override func viewDidLoad() { super.viewDidLoad() navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(clicked(_:)))

iOS: how to dismiss popovers [duplicate]

主宰稳场 提交于 2019-12-01 06:01:15
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to Dismiss a Storyboard Popover I have a iPad storyboard. A Bar Button Item in one View is Control-dragged to another view -- and a popover style is chosen. When I press the button the new popover view is shown in a popover, but I have two problems: When I press the button again, another instance of the popover view is displayed -- I can see, that the black border is getting darker and darker. If the popover

How to do “actionSheet showFromRect” in iOS 8?

时光怂恿深爱的人放手 提交于 2019-12-01 05:12:26
问题 In iOS 7, I show actionSheet by "showFromRect": [actionSheet showFromRect:rect inView:view animated:YES]; But in iOS 8, this doesn't work. They they replace the implementation and suggest us using UIAlertController. Then how do I show this actionSheet like a popover? 回答1: Using UIAlertController you can access the popoverPresentationController property to set the sourceView (aka inView) and sourceRect (aka fromRect). This gives the same appearance as the previous showFromRect:inView: