uipopovercontroller

how to present modal UIViewController dialog from bottom in IOS like this (image attached)

你。 提交于 2019-12-04 21:06:11
How would one present a UIViewController (from Storyboard say) that is modal, and slides up from the bottom of the presenting view controller. Requirements would be: slides up from bottom, with widths aligning with the width of the presenting view controller does NOT take up whole screen or whole parent presenting view controller (rather only is as high as required to show itself) can be shown within the context of a view controller which doesn't take the whole screen I do not use storyboards so I wrote it all out. You can copy paste this into a brand new project and run it to see it working.

Dismiss popover when clicking a uibutton

强颜欢笑 提交于 2019-12-04 21:04:56
I do have a popup view controller generated programmatically without a storyboard from the main view controller and would like to dismiss it once the input is being introduced by the user with a Done button on a tool bar at the popupview controller. I have been trying to use a protrocoll to dismiss the popover but it does not work. I have been fostering and applying several suggestions found in internet but all gave the same negative result. Do I oversee something? Here is the relevant code: Main View Controller .h #import <UIKit/UIKit.h> #import "PopOverContentVC.h" @interface

UIActivityViewController issue iOS 7 and iOS 8?

≡放荡痞女 提交于 2019-12-04 19:03:16
问题 I’m building an article reading app for iPad. I have integrated a social sharing functionality which means user can share articles on Facebook, and google mail. I’m using UIActivityViewController for sharing. There is a bar button item,when user click on that UIActivityViewController opens.I updated Xcode 6 When I run on simulator it runs fine But I run on real device(iPad) with iOS 7,the app get crash on clicking on bar button item. this is my code: - (IBAction)ysshareAction:(id)sender {

Dismissing UIPopoverController with -dismissPopoverAnimated: won't call delegate?

ⅰ亾dé卋堺 提交于 2019-12-04 16:37:48
问题 I have my UIPopoverController with self as a delegate: I receive calls when I tap outside the popover controller, but when I tap inside I want to dismiss too, so I use -dismissPopoverAnimated: but delegate is not called in this case. Is this normal? Is this a bug or I am doing something wrong? newDocPopoverController = [[UIPopoverController alloc] initWithContentViewController:vc]; [newDocPopoverController setPopoverContentSize:CGSizeMake(240, 44*4)]; [newDocPopoverController

iPad popover textfield - resignFirstResponder doesn't dismiss keyboard

只谈情不闲聊 提交于 2019-12-04 16:29:01
问题 I have two text fields email and password. The following code works fine when the fields are presented on a regular view but when they are on a popover, the resignFirstResponder does not work (becomeFirstResponder works). textFieldsShouldReturn was called for both fields. Any idea if I am missing something? Thanks! - (BOOL)textFieldShouldReturn:(UITextField *)theTextField { if (theTextField == email) { [password becomeFirstResponder]; return NO; } [theTextField resignFirstResponder]; return

Resizing behavior of UIPopoverController differs between iOS 7.0 and iOS 7.1

孤街醉人 提交于 2019-12-04 14:43:41
I have a UIPopoverController that contains a UITableViewController within a UINavigationController. Whenever a cell in this table view is pressed, I push yet another UITableViewController to my navigation Controller. I want to set the height of my second table view (let's say to 200) and adjust the size of the popover accordingly. I therefore first set the table view frame in viewDidAppear:(BOOL)animated and then call setPopoverContentSize:(CGSize)size animated:(BOOL)animated . Both heights are set to 200. The resizing works, but there are the following differences on the different iOS

Show tableView popover as soon as data is loaded

a 夏天 提交于 2019-12-04 14:32:27
问题 i want to show a my Popover with a TableView just from the beginning, when the app loads. Problem is that the tableView doesn't have any content then. I am using that method: UIBarButtonItem *barItem = [self.toolbar.items objectAtIndex:0]; [self.popoverController presentPopoverFromBarButtonItem:barItem permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES]; Now, my idea was to have a delegate method which is fired when the tableView finished fetching the data, but unfortunately

UIPopViewController not working

时光毁灭记忆、已成空白 提交于 2019-12-04 14:19:07
问题 I have an xib file with a .h and .m linked. In the xib there is a UIView with a textView. What I would like to do with that view is open it as a UIPopViewController when you click a button. Here is my code: - (IBAction)thisButton:(id)sender { popViewController *popVC = [[popViewController alloc] initWithNibName:@"popViewController" bundle:nil]; self.pop = [[UIPopoverController alloc] initWithContentViewController:popVC]; [self.pop setPopoverContentSize:CGSizeMake(220, 120) animated:YES];

How to setup Popover views to dismiss properly

吃可爱长大的小学妹 提交于 2019-12-04 11:37:38
问题 After some work I've got a popover view displaying a custom uiview inside of it appearing properly. When you tap outside of the popover view it dismisses as expected, however I'd also like it to dismiss when a button inside it is tapped, is there any one who can help me with that? Struggling to find a concise guide. 回答1: To dismiss the popover manually, you'll need to keep a reference to it. A good place would be in the view controller that shows the popover. To have the button inside the

Unwanted margin UIPopoverController

烈酒焚心 提交于 2019-12-04 11:25:29
When I present my popover in a view and place it at the side of the view. There is always a small margin, causing the popover to not stick to the side. UIViewController *vc = [self getViewController:@"popover" fromStoryboard:@"Main"]; UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:vc]; [popover presentPopoverFromRect:CGRectMake(1100, 0, -65, 65) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES]; [vc setPreferredContentSize:CGSizeMake(300, 300)]; How do I prevent this margin and show my popover sticking to the side of