uiactionsheet

Action sheet doesn't show Cancel button on iPad

烂漫一生 提交于 2019-11-29 01:10:43
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? This is part of the UI design and guidlines . Under 'Action Sheet' they say: Do not include a Cancel button, because people can tap outside the popover to dismiss the action sheet without selecting

Issue with UIActionSheet

帅比萌擦擦* 提交于 2019-11-28 23:39:23
问题 When I run my app and I click button for actionsheet appears this: Presenting action sheet clipped by its superview. Some controls might not respond to touches. On iPhone try -[UIActionSheet showFromTabBar:] or -[UIActionSheet showFromToolbar:] instead of -[UIActionSheet showInView:]. How can I fix? 回答1: Try this, it worked for me perfectly: [actionSheet showInView:[UIApplication sharedApplication].keyWindow]; 回答2: You could try [MyActionSheet showInView:super.view]; or if you have a UITabBar

Change text color in UIActionSheet buttons

余生长醉 提交于 2019-11-28 20:54:30
问题 In my project, I am using UIActionSheet for displaying for some sorting type. I want to change the color of the text displayed in the action sheet buttons. How can we change the text color? 回答1: iOS 8: UIActionSheet is deprecated. UIAlertController respects -[UIView tintColor] , so this works: alertController.view.tintColor = [UIColor redColor]; Better yet, set the whole window's tint color in your application delegate: self.window.tintColor = [UIColor redColor]; iOS 7: In your action sheet

How do I make a UIPickerView in a UIActionSheet

醉酒当歌 提交于 2019-11-28 19:58:34
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 initwithframe:? Please anyone help I know it is a stupid question but I'm racking my head on my $$$$$$

How to use UIAlertController to replace UIActionSheet?

牧云@^-^@ 提交于 2019-11-28 19:05:33
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:UIAlertControllerStyleActionSheet]; UIAlertAction* item = [UIAlertAction actionWithTitle:@"item" style

UIDatePicker in UIActionSheet on iPad

人盡茶涼 提交于 2019-11-28 18:53:05
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 destructiveButtonTitle:nil otherButtonTitles:@"Done", nil]; [self.dateActionSheet showInView:self.view];

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

喜夏-厌秋 提交于 2019-11-28 18:48:18
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)buttonIndex { if (buttonIndex == 0) { // take photo... } else if (buttonIndex == 1) { // choose existing photo...

iOS8统一的系统提示控件——UIAlertController

筅森魡賤 提交于 2019-11-28 16:56:12
iOS8统一的系统提示控件——UIAlertController 一、引言 相信在iOS开发中,大家对UIAlertView和UIActionSheet一定不陌生,这两个控件在UI设计中发挥了很大的作用。然而如果你用过,你会发现这两个控件的设计思路有些繁琐,通过创建设置代理来进行界面的交互,将代码逻辑分割了,并且很容易形成冗余代码。在iOS8之后,系统吸引了UIAlertController这个类,整理了UIAlertView和UIActionSheet这两个控件,在iOS中,如果你扔使用UIAlertView和UIActionSheet,系统只是会提示你使用新的方法,iOS9中,这两个类被完全弃用,但这并不说明旧的代码将不能使用,旧的代码依然可以工作很好,但是会存在隐患,UIAlertController,不仅系统推荐,使用更加方便,结构也更加合理,作为开发者,使用新的警示控件,我们何乐而不为呢。这里有旧的代码的使用方法: UIAlertView使用: http://my.oschina.net/u/2340880/blog/408873 。 UIActionSheet使用: http://my.oschina.net/u/2340880/blog/409907 。 二、UIAlertController的使用 从这个类的名字我们就可以看出,对于警示控件

UIActionSheet iOS Swift

时光总嘲笑我的痴心妄想 提交于 2019-11-28 16:17:20
How To Do UIActionSheet in iOS Swift? Here is my code for coding UIActionSheet. @IBAction func downloadSheet(sender: AnyObject) { let optionMenu = UIAlertController(title: nil, message: "Choose Option", preferredStyle: .ActionSheet) let saveAction = UIAlertAction(title: "Save", style: .Default, handler: { (alert: UIAlertAction!) -> Void in println("Saved") }) let deleteAction = UIAlertAction(title: "Delete", style: .Default, handler: { (alert: UIAlertAction!) -> Void in println("Deleted") }) let cancelAction = UIAlertAction(title: "Cancel", style: .Cancel, handler: { (alert: UIAlertAction!) ->

Creating UIActionSheet [duplicate]

若如初见. 提交于 2019-11-28 16:03:54
This question already has an answer here: Creating iPhone Pop-up Menu Similar to Mail App Menu 7 answers I would like to create this kind of menu, of course with other menu buttons. Is there any default viewcontroller representing it, or do I have to get images and create this by myself. Apollo SOFTWARE You need to use a UIActionSheet . First you need to add UIActionSheetDelegate to your ViewController.h file. Then you can reference an actionsheet with: UIActionSheet *popup = [[UIActionSheet alloc] initWithTitle:@"Select Sharing option:" delegate:self cancelButtonTitle:@"Cancel"