uiactionsheet

How to display custom view in UIActionSheet?

房东的猫 提交于 2019-12-10 18:14:19
问题 I have a UIView with a date picker that I'd like to display in an action sheet. I'm using the following code: -(IBAction) button_click:(id)sender{ //UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"the title" delegate:nil cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Destructive" otherButtonTitles:@"other", nil]; UIActionSheet *sheet = [[UIActionSheet alloc] init]; ActionSheetController *actionSheet = [[ActionSheetController alloc] initWithNibName:@"ActionSheetView" bundle

How to add UIDatePicker in UIAlertController in iOS8?

风流意气都作罢 提交于 2019-12-10 16:47:39
问题 I am working on a project which I had already released with iOS-7. But now as the action sheet is making problem so I am now implementing UIAlertController. Following is the code which I am using for showing UIAlertController with UIPicker. alertController = [UIAlertController alertControllerWithTitle:@"" message:@"" preferredStyle:UIAlertControllerStyleActionSheet]; UIAlertAction *alertAction = [UIAlertAction actionWithTitle:@"" style:UIAlertActionStyleDefault handler:nil]; [alertController

How do I code a green button in UIActionSheet?

孤街浪徒 提交于 2019-12-10 14:22:43
问题 I am using the code: { randomstatus=0; msg=[[NSString alloc]initWithFormat:@"Good job, do you want to continue?"]; UIActionSheet *actionSheet=[[UIActionSheet alloc]initWithTitle:msg delegate:self cancelButtonTitle:@"No" destructiveButtonTitle:@"Yes" otherButtonTitles:nil]; [actionSheet showInView:self.view]; [actionSheet release]; [msg release]; } I don't want to change the code, but I need the "destructiveButton" to be green instead of red. Is this possible, or do i need to use a different

Android: iOS UIActionSheet equivalent

限于喜欢 提交于 2019-12-09 16:43:14
问题 I am converting an iOS app over and need to implement the equivalent of a UIActionSheet from iOS to Android. What UI element would most closely mimic this. I am targeting Android 2.2 and up. 回答1: You would use an AlertDialog or Dialog object. The AlertDialog class does what you ask. Dialog allows for more customizability. Edit: if you want the same animative effect, you're going to need to use a SlidingDrawer. Note: None of these classes, except maybe the AlertDialog, are as easy to use as

UIActionSheet Change arrow position?

旧城冷巷雨未停 提交于 2019-12-09 07:47:57
问题 To show a UIActionSheet on the iPad I did this: [actionSheetX showFromRect:RectX inView:myView animated:YES]; The arrow of the popover points down, can I change this position to point left, up or right, like when using a normal popover? 回答1: Apple doesn't provide any access to internal structure for UIActionSheet's internal implementation of showFromRect , but as for arrow direction, there is actually a very hack-y way to work around this and sort of being able to change arrow direction to a

Showing actionsheet causes CGContext invalid context errors

半腔热情 提交于 2019-12-08 06:54:42
问题 I'm using actionsheet to display lists of data for the user to choose from. The problem is that showing the actionsheet using [self.actionSheet showInView:self.view]; is causing several CGContext errors. The same code worked well in iOS 6. Code: self.actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:nil cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil]; [self.actionSheet setActionSheetStyle:UIActionSheetStyleBlackOpaque]; CGRect tableFrame = CGRectMake(0,

Toolbar items dissapear when view changed with UIActionSheet

不羁岁月 提交于 2019-12-07 18:14:40
问题 When initiating a view from a UIActionSheet button, upon returning to the view via the navigationBar back button, the toolbar while still visible does not have any of the buttons that were previously on it. This error has arisen since updating to iOS 6 and occurs while testing it on the simulator and a device running iOS 6 only. If I comment out the code that hides the toolbar on the view pushed by the UIActionSheet the buttons are added when going back. I'm making my toolbar items

UIActionSheet checkmark

人盡茶涼 提交于 2019-12-07 12:16:07
问题 I need to mark selected button in UIActionSheet. How can I add checkmark in UIActionSheet button? Is there some way specific for UIActionSheet, without standard adding image inside button. 回答1: otherButtonTitles:@"√ 1", @" 2", 回答2: Starting from iOS 8.0 you can use UIAlertController . In UIAlertController , each button item is know as UIAlertAction which add accordingly. UIAlertAction contains a runtime property called image which you can set as per your need. UIAlertActioin *action1 =

How to dismiss UIActionSheets and UIPopoverControllers without knowing who presented them

帅比萌擦擦* 提交于 2019-12-07 11:48:14
问题 In my client application I have an idle timeout control mechanism and when the user does not do anything with the app for a specified time interval, I display a warning and throw him back to the login screen. This control happens in my container view where I initiate all of my other views. When the idle time is up, I pop this container view to its caller, i.e the login screen. The problem is, if the user does sthg that displays an action sheet or a popover and then does not do anything until

UIActionSheet in iOS7 dismissing when user taps ANYWHERE on the screen on iPhone

旧巷老猫 提交于 2019-12-07 04:27:46
问题 I've noticed that in iOS 7 a **UIActionSheet** automatically dismisses when a user taps anywhere on the screen on an **iPhone** . This was NOT the case in iOS 6 and is leading to unintended effects. Is this a UI change? Bug? Is there a way to disable this? From iOS 7 docs: "As described in iOS human interface guidelines, you should include a Cancel button with action sheets displayed on iPhone and with those displayed on iPad over an open popover. Otherwise on iPad, action sheets are