Add to action sheet

Can I add my custom UIViewController to an ActionSheet?

thanks

+4
source share
3 answers

Finally, I found it ... I added a view, which is a subclass of the UIViewController in the UIActionSheet. I created the view in a separate file (using xib).

UIActionSheet *asheet = [[UIActionSheet alloc] init]; [asheet showInView:self.view]; [asheet setFrame:CGRectMake(0, 230, 320, 230)]; CustomView *innerView = [[CustomView alloc] initWithNibName:@"CustomView" bundle:nil]; innerView.view.frame = CGRectMake(0, 10, 320, 210); [asheet addSubview:innerView.view]; //[asheet addSubview:innerView]; [innerView release]; [asheet release]; 
+11
source

I recently created an application in which I created an action sheet and added a selection view to it.
First, you need to create an object for the action sheet in your .h file, as well as its properties, as follows:

 UIActionSheet *menuProperty; @property(nonatomic,retain) UIActionSheet *menuArea; 

Then you need to make the following changes to your .m file

 menuArea = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Done" destructiveButtonTitle:nil otherButtonTitles:nil]; // Add the picker pickerArea = [[UIPickerView alloc] initWithFrame:CGRectMake(0,185,0,0)]; pickerArea.delegate = self; pickerArea.showsSelectionIndicator = YES; // note this is default to NO [menuArea addSubview:pickerArea]; [menuArea showInView:self.view]; [menuArea setBounds:CGRectMake(0,0,320, 600)]; 
+1
source

I think these links will help u. I have never added a presentation to the uiaewsheet, but after a bit of searching, which I think we can add.

http://www.ifans.com/forums/showthread.php?t=301851

how to add an action sheet to a table view cell

-1
source

Source: https://habr.com/ru/post/1344752/


All Articles