Search Results

Search found 58 results on 3 pages for 'uiactionsheet'.

Page 1/3 | 1 2 3  | Next Page >

  • How to display custom view in UIActionSheet?

    - by 4thSpace
    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:nil]; [sheet addSubview:actionSheet.view]; [sheet showInView:self.view]; } What I get is a little bit of the top part of the new view coming up from the bottom and that's it. If I comment the two middle lines of code and uncomment the top part to display a regular action sheet, it works fine. Any ideas what I might be doing wrong?

    Read the article

  • UIActionSheet position on landscape and portrait

    - by Dave
    UIActionSheet positioning is not centered when I open it in landscape mode. If I set bounds or change the frame. The contents inside the UIActionSheet which is a subview changes but the actual sheet remains in the same place which looks very awkward. How do I move the UIActionSheet along with it's subview to the center of the screen?

    Read the article

  • Get the UIWindow which is under the UIActionSheet

    - by Georgi
    I am trying to present a new UIViewController on top of the current current UIViewController. Here is the line of code that creates the desired effect: LoginViewController *loginViewController = [[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil]; UIViewController *rootController = [[[UIApplication sharedApplication] keyWindow] rootViewController]; [rootController presentViewController:loginViewController animated:YES completion:nil]; The problem is that I added an UIActionSheet which asks the user to confirm the desired action (which is to log out). When the user confirms the action I run the above mentioned peace of code, but the UIActionSheet is still the keyWindow. Therefore the LoginViewController is not presented on top (the rootController is null when I try to debug). My question is: Can I somehow find the UIWindow which is under the UIActionSheet and from there get the root controller,or maybe I can dismiss programmatically the UIActionSheet when the users selects the log out action and only then execute the above code? Thank you in advance!

    Read the article

  • Change UIActionSheet after doing it's job

    - by mongeta
    Hello, I have to import some XML data into my app. Now I open a UIActionSheet and add as a subview a UIActivityIndicatorView. Initially I show a progress wheel and a button with 'Cancel'. When the XML has been imported, I want to hide the progress wheel (this it's easy) and change the button into a 'Done' button, all in the same UIActionSheet. What I'm doing now is closing the UIActionSheet with the option dismissWithClickedButtonIndex, but I don't like this way because it's the same as pressing 'Cancel', and then I show an UIAlertView displaying "All data has been imported". Is this possible ? thanks, regards, r.

    Read the article

  • UIActionSheet not responding to touches

    - by mongeta
    Hello, I can't touch any button in my UIActionSheet. If I copy/paste this code in a new project, it works as expected. I'm forcing the First Responder = doesn't work I'm using [menu showFromTabBar:self.tabBarController.tabBar]; = doesn't work I'm using [menu showInView:self.view.window]; = doesn't work UIActivityIndicatorView *progressView = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(150, 105, 25, 25)]; progressView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge; UIActionSheet *menu = [[UIActionSheet alloc] initWithTitle:@"first_time_loading" delegate:self cancelButtonTitle:@"device_stop_info" destructiveButtonTitle:nil otherButtonTitles:nil]; [menu addSubview:progressView]; [menu setTag:9]; [menu becomeFirstResponder]; [menu showInView:self.view]; // [menu becomeFirstResponder]; [menu setBounds:CGRectMake(0,0,320, 175)]; [progressView startAnimating]; [progressView hidesWhenStopped]; [menu becomeFirstResponder]; Don't know where to look for more ideas ... I'm opening from a UITableViewController in: - (void)viewDidAppear:(BOOL)animated { // doesn't work -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath // doesn't work thanks, r.

    Read the article

  • UIActionSheet positioning problem

    - by Dave
    I need to display a pop with a UISwitch and a Done button when user taps on a button and save the state of the switch when the done button in the pop up is tapped. So I use UIActionSheet to do this - sheet = [[UIActionSheet alloc] initWithTitle:@"Switch Setting" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:@"Done", nil]; theSwitch = [[UISwitch alloc] init]; [sheet addSubview:theSwitch]; [sheet showInView:self.view]; - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex == actionSheet.firstOtherButtonIndex) { theSwitch .on? NSLog(@"Switch is on") : NSLog(@"Switch if off"); } } All this works great. I have problem with positioning. Unfortunately, I don't have a screen shot at the moment to post here. But the switch appears at the very top on the same line with the Action Sheet title and then below that is the Done button. Please someone help me how to position the switch below the Title and increase the Action Sheet size so it looks neat. I need this asap. Thanks.

    Read the article

  • Controls in UIActionSheet are positioning wrong

    - by Dave
    I need to display a pop with a UISwitch and a Done button when user taps on a button and save the state of the switch when the done button in the pop up is tapped. So I use UIActionSheet to do this - sheet = [[UIActionSheet alloc] initWithTitle:@"Switch Setting" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:@"Done", nil]; theSwitch = [[UISwitch alloc] init]; [sheet addSubview:theSwitch]; [sheet showInView:self.view]; - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex == actionSheet.firstOtherButtonIndex) { theSwitch .on? NSLog(@"Switch is on") : NSLog(@"Switch if off"); } } All this works great. I have problem with positioning. Unfortunately, I don't have a screen shot at the moment to post here. But the switch appears at the very top on the same line with the Action Sheet title and then below that is the Done button. Please someone help me how to position the switch below the Title and increase the Action Sheet size so it looks neat. I need this asap. Thanks.

    Read the article

  • UIActionSheet With PickerView not showing up in iPad

    - by user717452
    I am using the following code to add an actionsheet with a picker view on it to my app. From the iPhone, it displays perfectly, but when viewing on iPad (Universal app), it shows a very small pickerview with none of the other buttons right on the center of the page. UIActionSheet *menu = [[UIActionSheet alloc] initWithTitle:@"Select Chapter" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Select" otherButtonTitles:nil]; // Add the picker UIPickerView *pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0,185,0,0)]; pickerView.delegate = self; pickerView.showsSelectionIndicator = YES; // note this is default to NO [menu addSubview:pickerView]; [menu showFromTabBar:self.tabBarController.tabBar]; [menu setBounds:CGRectMake(0,0,320, 700)]; [pickerView release]; [menu release];

    Read the article

  • UIActionSheet Cancel button keeps crashing my app

    - by user337174
    I am really puzzeled by this one. I have set up two UIActionSheets in my application. They work perfectly fine until you use the cancel button in the UIActionSheets. When i navigate away from the page the UIAactionSheet returns too it crashes my app. Does anyone have any ideas as too why? -(IBAction) phoneButtonClicked:(id)sender { // open a dialog with just an OK button phoneActionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:[NSString stringWithFormat:@"Phone: %@",phone],nil]; phoneActionSheet.actionSheetStyle = UIActionSheetStyleDefault; [phoneActionSheet showInView:self.view]; // show from our table view (pops up in the middle of the table) [phoneActionSheet release]; } -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { if (actionSheet == phoneActionSheet) { if(buttonIndex == 0){ NSString *callPhone = [NSString stringWithFormat:@"tel:%@",phone]; NSLog(@"Calling: %@", callPhone); [[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]]; } } }

    Read the article

  • iOS iPad UIActionSheet Issue

    - by hart1994
    I am currently developing an application which needs an option to 'share' using multiple services; such as email, twitter. To to this, I have a UIBarButtonItem coded in and when touched, it triggers this: UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil]; [sheet addButtonWithTitle:@"Email"]; [sheet addButtonWithTitle:@"Tweet"]; [sheet addButtonWithTitle:@"Cancel"]; sheet.cancelButtonIndex = sheet.numberOfButtons-1; [sheet showFromRect:self.view.bounds inView:self.view animated:YES]; [sheet release]; In conjunction with this to detect which button is selected: clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex == actionSheet.cancelButtonIndex) { return; } switch (buttonIndex) { case 0: { [self emailThis]; break; } case 1: { [self tweetThis]; break; } } This works a treat on the iPhone. But unfortunately it displays incorrectly on the iPad. It looks like it is trying to display the UIPopoverController, but it is positioned center of the navbar with practically no height. I have looked into using the UIPopoverController, but I cannot seem to find out how to use it with buttons. Is there anyway I can adapt the code above to properly display the buttons, as it's trying to already. Many thanks, Ryan PS: I'm new to objective-c/iOS coding, so please be specific. Thank you :)

    Read the article

  • How to make UIImagePickerController works under switch case UIActionSheet

    - by Phy
    -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage *tempImage = [info objectForKey:UIImagePickerControllerOriginalImage]; imgview.image = tempImage; [self dismissModalViewControllerAnimated:YES]; [picker release]; } -(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { [self dismissModalViewControllerAnimated:YES]; [picker release]; } -(IBAction) calllib { img1 = [[UIImagePickerController alloc] init]; img1.delegate = self; img1.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; [self presentModalViewController:img1 animated:YES]; } all the codes above works well for taking out photos from the photo library. problem is that when i tried to use it under the UIActionSheet it does not work. i just copy the lines of codes from the -(IBAction) calllib as follow. (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { UIImage *detectface = [Utilities detectFace:imgview.image]; UIImage *grayscale = [Utilities grayscaleImage:imgview.image]; UIImage *avatars = [Utilities avatars:imgview.image]; img1 = [[UIImagePickerController alloc] init]; img1.delegate = self; img1.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; switch (buttonIndex) { case 0: [self presentModalViewController:img1 animated:YES]; imgview.image = detectface; break; case 1: [self presentModalViewController:img1 animated:YES]; imgview.image = grayscale; break; case 2: [self presentModalViewController:img1 animated:YES]; imgview.image = avatars; break; default: break; } } it does not work. can somebody help me to figure out what is the problem? the switch case works perfectly without the [self presentModalViewController:img1 animated:YES]; ... thanks

    Read the article

  • Accessing UIPopoverController for UIActionSheet on iPad

    - by westsider
    On the iPad, one can show a UIActionSheet using -showFromBarButtonItem:animated:. This is convenient because it wraps a UIPopoverController around the action sheet and it points the popover's arrow to the UIBarButtonItem that is passed in. However, this call adds the UIBarButtomItem's toolbar to the list of passthrough views - which isn't always desirable. And, without a pointer to the UIPopoverController, one can't add other views to the passthrough list. Does anyone know of a sanctioned approach to getting a pointer to the popover controller? Thanks in advance.

    Read the article

  • Ipad/Iphone UIActionSheet

    - by SteveU
    Hi All, Ive only posted on here a couple of times and people have been very quick and very helpful when responding so thanks. Im trying to use the UIActionsheet element in my Ipad application. But just to confuse matters im using Cocos2d aswell. But here is my problem. If coding the actionsheet with out cocos2d you would use the following code. [actionSheet showInView:self.view]; However because im using cocos2d and there is no views as such the only thing i can think of to reference is the window.. But this is located in the appdelegate class. ive tried [actionSheet showInView:self.Window]; and i get errors any help?

    Read the article

  • Passing values from UIButton to an UIActionSheet

    - by Michael
    I'm trying to send an ActionSheet a variable from a button. I can't use the tag property because its being used for something else. I've declared myIndexRow as an instance variable and have: NSInteger myIndexRow = indexPath.row; [deleteButton addTarget:self action:@selector(showDeleteSheet:) forControlEvents:UIControlEventTouchUpInside]; deleteButton.myIndexRow = myIndexRow; but I'm getting the 'Request for member 'myRow' is something not a structure or union' There is something obvious I am missing here.

    Read the article

  • What could cause a button on a UIActionSheet to "miss" on touches?

    - by Alex Gosselin
    I have a UIActionSheet as follows: UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:[NSString stringWithFormat: @"Cancel New %@? Changes will be lost.", [creator propertyName]] delegate:self cancelButtonTitle:@"Stay Here" destructiveButtonTitle:@"Discard and Close" otherButtonTitles:@"Save and Close", nil]; [sheet showInView:self.view]; [sheet release]; It creates the action sheet, The buttons display, the Destructive button is on top, cancel button is on the bottom, other button (save and close) shows up in the middle, the top two buttons, (destructive and other) work fine, but the bottom button has a gap, so it is farther down than the other buttons. For some reason though, in order to press the button I need to touch where it would be if there was no gap. Touching the actual button doesn't work. Sorry if this isn't super clear, has anyone encountered something like this? I don't like to whip out the "I found a bug" card too fast, maybe I'm doing something wrong here.

    Read the article

  • How to set the back groung color to the UIActionSheet in iPhone?

    - by Madan Mohan
    Hi Guys, I need to change the back ground colour of the action sheet, UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:@"Create Estimate", @"Record Expense",@"Add Credit",@"Delete Customer", @"Cancel", nil]; actionSheet.actionSheetStyle = UIActionSheetStyleDefault; actionSheet.destructiveButtonIndex=3; [actionSheet showInView:appDelegate.window]; // show from our table view (pops up in the middle of the table) [actionSheet release]; please tell how to set the back ground color for action sheet.

    Read the article

  • Why Is Bottom Half of Custom UIActionSheet with UIDatePicker Disabled?

    - by Gorgando
    Everything seems to be working great with my UIActionSheet that contains a UIDatePicker except that the bottom half of the DatePicker is disabled. Visually there is a shadow that makes the bottom half of the picker darker than the top half. Everything in the bottom half is disabled and I can't for the life of me figure out how to enable it. I also noticed in my other "normal" UIActionSheets that just contain buttons, the bottom half of the cancel buttons are disabled. This is the code for my custom UIActionSheet: self.datePickerView = [[UIDatePicker alloc] init]; self.datePickerView.datePickerMode = UIDatePickerModeDate; self.actionSheet = [[UIActionSheet alloc] initWithTitle:@"Choose a Follow-up Date" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:@"Done", nil]; [self.actionSheet showInView:self.view]; [self.actionSheet addSubview:self.datePickerView]; [self.actionSheet sendSubviewToBack:self.datePickerView]; [self.actionSheet setBounds:CGRectMake(0,0,320, 500)]; CGRect pickerRect = self.datePickerView.bounds; pickerRect.origin.y = -95; self.datePickerView.bounds = pickerRect; I've tried several things including sendSubviewToBack, BringSubviewToFront, etc but I have not had any luck. I appreciate your help!

    Read the article

  • How do I code a green button in UIActionSheet?

    - by Joshua
    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 button?

    Read the article

  • Why does UIActionSheet cancel crahes my App?

    - by Tim Büthe
    I try to use the UIActionSheet within my iPhone App but have the following problem. When I tap the cancel button "I don't", the app crashes. When I remove the NSLog statement from the actionSheet:clickedButtonAtIndex: it does not. The "Yes, do it" button works just fine and I see the log statement in the console. What's wrong? - (void) doItWithConfirm { UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"do you really wanna do it?" delegate:self cancelButtonTitle:@"I don't" destructiveButtonTitle: nil otherButtonTitles:@"Yes, do it", nil]; [actionSheet showInView:self.view]; [actionSheet release]; } - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { NSLog(@"buttonIndex: %@", buttonIndex); }

    Read the article

  • Accessing ViewController's variables from UIActionSheet delegate

    - by VansFannel
    Hello. I have the following code: @implementation SendMapViewController NSMutableArray *emails; At this method I create emails array and I add some NSStrings: - (BOOL) peoplePickerNavigationController: (ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson: (ABRecordRef)person { ABMultiValueRef emailInfo = ABRecordCopyValue(person, kABPersonEmailProperty); NSUInteger emailCount = ABMultiValueGetCount(emailInfo); if (emailCount > 1) { UIActionSheet *emailsAlert = [[UIActionSheet alloc] initWithTitle:@"Select an email" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil]; emails = [NSMutableArray arrayWithCapacity: emailCount]; for (NSUInteger i = 0; i < emailCount; i++) { NSString *emailFromContact = (NSString *)ABMultiValueCopyValueAtIndex(emailInfo, i); [emails addObject: emailFromContact]; [emailsAlert addButtonWithTitle:emailFromContact]; [emailFromContact release]; } [emailsAlert addButtonWithTitle:@"Cancel"]; [emailsAlert showInView:self.view]; [emailsAlert release]; } else { ... } CFRelease(emailInfo); [self dismissModalViewControllerAnimated:YES]; return NO; } As you can see in code, if there are more than one email I show and UIActionSheet. When user clicks on a button representing and email, I want to execute the following code: - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { if ([emails count] >= buttonIndex) { NSString *contactEmail = (NSString *)[emails objectAtIndex:buttonIndex]; ... } } But emails array hasn't got any email. What I'm doing wrong? I'm developing for iPhone.

    Read the article

  • How to display the UIActionSheet view from above Tab Bar Controller?

    - by Madan Mohan
    Hi Guys , I need to display the action sheet above the Tab Bar controller. I mean, I would be able to see the Tab Bar controller even the action sheet view is in visible mode. So, Please suggest how to view from above the Tab Bar controller. Is it possible. secondly, How to change the back ground color of action sheet and cancel button back ground colour. Please help me Thank You, Madan Mohan.

    Read the article

  • Creating Actions from UIActionSheets help

    - by user337174
    I am using two UIAction sheets within my current project. I can get one to work perfectly fine but when i insert a second action sheet it runs the same arguements as the first. How do i define the actionsheets seperatly? -(IBAction) phoneButtonClicked:(id)sender { // open a dialog with just an OK button UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:[NSString stringWithFormat:@"Phone: %@",phone],nil]; actionSheet.actionSheetStyle = UIActionSheetStyleDefault; [actionSheet showInView:self.view]; // show from our table view (pops up in the middle of the table) [actionSheet release]; } -(IBAction) mapButtonClicked:(id)sender { // open a dialog with just an OK button UIActionSheet *mapActionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:[NSString stringWithFormat:@"Map"],nil]; mapActionSheet.actionSheetStyle = UIActionSheetStyleDefault; [mapActionSheet showInView:self.view]; // show from our table view (pops up in the middle of the table) [mapActionSheet release]; } -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { if(buttonIndex == 0){ NSString *callPhone = [NSString stringWithFormat:@"tel:%@",phone]; NSLog(@"Calling: %@", callPhone); [[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]]; } }

    Read the article

  • App crashes frequently at time when UIActionSheet would be presented

    - by Jim Hankins
    I am getting the following error intermittently when a call is made to display an action sheet. Assertion failure in -[UIActionSheet showInView:] Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: view != nil' Now in this case I've not changed screens. The UIActionSheet is presented when a local notification is fired and I have an observer call a local method on this view as such: I have the property marked as strong. When the action sheet is dismissed I also set it to nil. I am using a story board for the UI. It's fairly repeatable to crash it, perhaps less than 5 tries. (Thankfully I have that going for me). Any suggestions what to try next? I'm really pulling my hair out on this one. Most of the issues I've seen on this topic are pointing to the crash occurring once the selection is made. In my case it's at presentation and intermittently. Also for what it's worth, this particular view is several stacks deep in an embedded navigation controller. Hometableviewdetail selectviewController in question. This same issue occurs so far in testing on iOS 5.1 and iOS 6. I'm presuming it's something to do with how the show InView is being targeted. self.actionSheet = [[UIActionSheet alloc] initWithTitle:@"Select Choice" delegate:self cancelButtonTitle:@"Not Yet" destructiveButtonTitle:@"Do this Now" otherButtonTitles:nil]; [self.actionSheet showInView:self.parentViewController.tabBarController.view];

    Read the article

  • how i can deal with Uiactionsheet and three20 ?

    - by rain
    i am follow this tutorial http://iosstuff.wordpress.com/2011/0...e20-framework/ I know about displaying a single photo by clicking on one from the thumbnail viewer is provided to you for free by Three20. In addition, the library also provides all of the native functions such as pinch-to-zoom, swiping to navigate and tapping to hide/show the navigation arrows and back button. I want to add a button that if clicked by the user, would display a UIActionSheet with options for sharing the photo by mail or MMS and the user would choose one of them. I see a lot of tutorials about this but I need to do this by my self. so plz help me

    Read the article

1 2 3  | Next Page >