uiactionsheet

Swift UIAlertController -> ActionSheet iPad iOS8 Crashes

浪尽此生 提交于 2019-11-27 18:05:37
currently i'm running into big trouble with my ActionSheet. On iPhone it works great, but on iPad it only crashes I create a new project with only one button import UIKit extension ViewController : UIActionSheetDelegate { func actionSheet(actionSheet: UIActionSheet, didDismissWithButtonIndex buttonIndex: Int) { if actionSheet.tag == 0 { if buttonIndex == 1 { // doing something for "product page" } else if (buttonIndex == 2) { // doing something for "video" } } } } class ViewController: UIViewController, UIActionSheetDelegate { @IBAction func test(sender: AnyObject) { let systemVersion:

How to customize UIActionSheet? iOS

余生颓废 提交于 2019-11-27 17:32:42
Is it possible to create an ActionSheet that have a label between two buttons like this image? Really need this right now. Can anyone help me? Thanks. EDIT 2018 I posted this code all the way back in iOS4 when it was potentially useful. iOS Development has grown staggeringly since then, please do not use this code unless you are writing an app for iOS4 for whatever reason! Please refer to the wonderful 3rd party library XLR Action Controller for your mondern actionsheet needs! It is most certainly possible, and I like to do this all the time! First, make a @property of an UIActionSheet (in

UIActionSheet cancel button strange behaviour

自作多情 提交于 2019-11-27 16:43:26
I have a UIBarButtonItem opening an action sheet to offer users choices about what to do. Everything works as expected unless I try to click on the "Cancel" button. The target of the button appears to have moved up from where it should be. I can only activate it by clicking somewhere in the middle of the "Cancel" and "Ok" buttons. I've tried at action sheets in other applications and they work fine, so it's not just my big thumb. The action sheet is opening in a UIViewController - (void)showOpenOptions { UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:NSLocalizedString(@"Open link

Action sheet doesn't show Cancel button on iPad

情到浓时终转凉″ 提交于 2019-11-27 15:41:25
问题 On the iphone, this code shows the cancel button: - (IBAction)buttonPressed { UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Are you sure?" delegate:self cancelButtonTitle:@"No way!" destructiveButtonTitle:@"Yes, I'm sure!" otherButtonTitles:nil]; [actionSheet showInView:self.view]; [actionSheet release]; } But on the iPad, only the destructive button shows. What's the problem? 回答1: This is part of the UI design and guidlines. Under 'Action Sheet' they say: Do not include

Is it possible to edit UIAlertAction title font size and style?

ε祈祈猫儿з 提交于 2019-11-27 15:11:06
Now that iOS8 deprecated UIActionsheet and UIAlertview the customization working on iOS7 is not taking effect anymore. So far the only customization I'm aware is the tint color. And what I need is changing the title's font size and style which I haven't found any way of doing so with the new UIAlertAction . Already referred to this but I'm still hoping there's a way to change at least the title size and font. Providing you some of my code for UIAlertAction UIAlertController * alertActionSheetController = [UIAlertController alertControllerWithTitle:@"Settings" message:@"" preferredStyle

How do I make a UIPickerView in a UIActionSheet

杀马特。学长 韩版系。学妹 提交于 2019-11-27 12:35:58
问题 Just want to know how I would make a UIPickerView in a UIActionSheet with a simple array. Ok well I actually found out how to put it into an action sheet but I like your way better because it applies more to my app, thanks, but I want to also know how put the options into the UIPickerView, I am just hung up on that part of that. I already have an array with the colors: red, green, blue, yellow, black, etc in it but I want to know how to put that into the pickerview if I have already used

How to use UIAlertController to replace UIActionSheet?

只愿长相守 提交于 2019-11-27 11:52:25
问题 I am maintaining an old iOS project which based on SDK 6.0. A method on this project called -(void) showComboBox:(UIView*)view:withOptions:(NSDictionary*)options is used to show a combo box. To achieve the goal, it used UIActionSheet, which is deprecated on iOS8. My solution is like this: if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber10_8) { UIAlertController* alertController = [UIAlertController alertControllerWithTitle:@"title" message:@"message" preferredStyle

ActionSheet not working iPad

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 11:44:42
I'm using ActionSheet in my application. On my iPhone it works, but it doesn't on the iPad simulator. this is my code: @IBAction func dialog(sender: AnyObject) { let optionMenu = UIAlertController(title: nil, message: "Choose Option", preferredStyle: .ActionSheet) let deleteAction = UIAlertAction(title: "Delete", style: .Default, handler: { (alert: UIAlertAction!) -> Void in println("Filtre Deleted") }) let cancelAction = UIAlertAction(title: "Cancel", style: .Cancel, handler: { (alert: UIAlertAction!) -> Void in println("Cancelled") }) optionMenu.addAction(deleteAction) optionMenu.addAction

UIDatePicker in UIActionSheet on iPad

a 夏天 提交于 2019-11-27 11:42:45
问题 In the iPhone version of my app, I have a UIDatePicker in a UIActionSheet . It appears correctly. I am now setting up the iPad version of the app, and the same UIActionSheet when viewed on the iPad appears as a blank blank box. Here is the code I am using: UIDatePicker *datePickerView = [[UIDatePicker alloc] init]; datePickerView.datePickerMode = UIDatePickerModeDate; self.dateActionSheet = [[UIActionSheet alloc] initWithTitle:@"Choose a Follow-up Date" delegate:self cancelButtonTitle:nil

UIPopover How do I make a popover with buttons like this?

两盒软妹~` 提交于 2019-11-27 11:41:01
问题 I'm wondering how I can create a popover with buttons like this. ANSWER: UIActionSheet * actionSheet = [[UIActionSheet alloc] initWithTitle: nil delegate: self cancelButtonTitle: nil destructiveButtonTitle: nil otherButtonTitles: @"Take Photo", @"Choose Existing Photo", nil]; [actionSheet showFromRect: button.frame inView: button.superview animated: YES]; Somewhere else in your delegated object class... -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger