uiactionsheet

Actually using UIDatePickerModeCountDownTimer as a timer

时光毁灭记忆、已成空白 提交于 2019-12-22 12:14:48
问题 I am just trying to make a timer. I would like to use UIDatePickerModeCountDownTimer mode of the UIDatePicker , so that when the user simply selects say 15 mins in the picker, they are passed back to a screen that shows the value of 15 mins in a label that they can then count down from. As I have tried to get the value from the DatePicker, I realized that the picker passes back an NSTimeInterval that gets the current time in seconds: UIDatePicker *pickerView = [[UIDatePicker alloc] init];

Is there any way to change the title font size in a UIActionSheet?

試著忘記壹切 提交于 2019-12-22 04:08:25
问题 The font is very small and hard for some to read so I'd like to make it closer to the font size used on the buttons below it. 回答1: You can change font property after show method(like showFromBarButtonItem) as below. CGRect oldFrame = [(UILabel*)[[sheet subviews] objectAtIndex:0] frame]; UILabel *newTitle = [[[UILabel alloc] initWithFrame:oldFrame] autorelease]; newTitle.font = [UIFont boldSystemFontOfSize:17]; newTitle.textAlignment = UITextAlignmentCenter; newTitle.backgroundColor = [UIColor

iOS 8 iPad only bug with action sheets

霸气de小男生 提交于 2019-12-22 00:26:10
问题 On an iPhone running iOS 8, the code below causes an action sheet to pop up. However, on an iPad running iOS 8 the code below does not cause an action sheet to pop up and instead nothing happens. NSUserDefaults *defauj = [NSUserDefaults standardUserDefaults]; NSArray *cod = [defauj objectForKey:@"customlistofstuff"]; UIActionSheet* actionSheet = [[UIActionSheet alloc] init]; actionSheet.delegate = self; for(int i=0;i<[cod count];i++) { [actionSheet addButtonWithTitle:[cod objectAtIndex:i]]; }

Add datepicker in UIActionsheet using Swift

Deadly 提交于 2019-12-21 18:05:25
问题 Is there any way to present the datepicker from UIAlertControllerStyle.ActionSheet ? There is way to add buttons and add actions to those buttons in the ActionSheet, but i couldn't find a solution to add a datepicker or any custom view in the ActionSheet. 回答1: It is not possible, but you can use a UItextfield input view and accessory view to show and dismiss a datepicker when the user clicks the textfield class KPDatePickerViewController: UIViewController { var datePicker:UIDatePicker!

Add datepicker in UIActionsheet using Swift

非 Y 不嫁゛ 提交于 2019-12-21 18:04:42
问题 Is there any way to present the datepicker from UIAlertControllerStyle.ActionSheet ? There is way to add buttons and add actions to those buttons in the ActionSheet, but i couldn't find a solution to add a datepicker or any custom view in the ActionSheet. 回答1: It is not possible, but you can use a UItextfield input view and accessory view to show and dismiss a datepicker when the user clicks the textfield class KPDatePickerViewController: UIViewController { var datePicker:UIDatePicker!

UIActionSheet with swift

断了今生、忘了曾经 提交于 2019-12-21 07:56:22
问题 I created an action sheet, but the problem is that the delegate method is not called myActionSheet = UIActionSheet() myActionSheet.addButtonWithTitle("Add event") myActionSheet.addButtonWithTitle("close") myActionSheet.cancelButtonIndex = 1 myActionSheet.showInView(self.view) /// UIActionSheetDelegate func actionSheet(myActionSheet: UIActionSheet!, clickedButtonAtIndex buttonIndex: Int){ if(myActionSheet.tag == 1){ if (buttonIndex == 0){ println("the index is 0") } } } I used another way

Using UIActionSheet on iPad

孤人 提交于 2019-12-21 06:58:48
问题 Apple's documentation for the UIActionSheet is causing me confusion. First off, in the iPad Human Interface Guidelines, it says : To learn more about using an action sheet in your code, see “Using Popovers to Display Content” in iPad Programming Guide. But then in the "Using Popovers to Display Content" section, it doesn't mention Action Sheets at all! Am I missing something here? http://developer.apple.com/library/ios/#documentation/General/Conceptual/iPadHIG/UIElements/UIElements.html#/

iPad's UIActionSheet showing multiple times

那年仲夏 提交于 2019-12-21 03:56:10
问题 I have a method called -showMoreTools: which is: - (IBAction) showMoreTools:(id)sender { UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:nil destructiveButtonTitle:@"Close" otherButtonTitles:@"Add Bookmark", @"Add to Home Screen", @"Print", @"Share", nil]; popupQuery.actionSheetStyle = UIActionSheetStyleDefault; popupQuery.dismiss [popupQuery showFromBarButtonItem:moreTools animated:YES]; [popupQuery release]; } When an user taps a

UIActionSheet cancel button not dismissing actionsheet

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-21 03:43:26
问题 I have an UIActionSheet and I am specifying the cancel button however it does not dismiss when its tapped? UIActionSheet *actionSheet = [[[UIActionSheet alloc]initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Target Complete" otherButtonTitles:nil] autorelease]; [actionSheet showInView:self.view]; According to the documentation I don't need any code and even when I try and implement the didCancel delegate method its never called? 回答1: Try this [actionSheet

How to add UIActionSheet button check mark?

夙愿已清 提交于 2019-12-20 20:37:47
问题 I wonder how to add check mark to the right of actionSheet button the simplest way? Bellow is a screenshot of Podcasts app. 回答1: Note that the solution can crash in a future update to iOS. I'm accessing undocumented private APIs. Such solutions are very fragile. Please see the comments below. Finally I got the answer by using UIAlertController: UIAlertController *customActionSheet = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];