Uialertview prompt user to help user select box
Uialertview *alterview = [[Uialertview alloc] initwithtitle:@ "Warning" message:@ "You have not finished the information" Delegate:nil CANCELBUTTONTITL e:@ "Cancle" otherbuttontitles:@ "confirmation", nil];
[Alterview show];
[Alterview release];
Alterview *alterview = [[Alterview alloc] initwithtitle:@ "Warning" message:@ "You haven't finished the information yet" delegate:self
cancelbuttontitle:@ "Cancle" otherbuttontitles:@ "confirm", @ "reconfirm", nil];
Alterview.tag=identifier;
[Alterview release];
identifier++;
/**
Title: View Title
Delegate: Setting up the agent
Cancelbuttontitle: The title of the Cancel button
Destructivebuttontitle: Title of the Special tagged button
Otherbuttontitles: Title of other buttons
*/
Uiactionsheet*actionsheet =[[Uiactionsheet Alloc]Initwithtitle:@ " hint " Delegate:self cancelbuttontitle:@ "Cancel" destructivebuttontitle :@ " title " //emphasized < Span class= "S1" >otherbuttontitles:@ " select 1" Span class= "S3", @ " select 2" ,@ " select 3 ",nil];
[Actionsheet showinview:self. Window];
[Actionsheet release];
Introduction of common methods and properties
@property (nonatomic,copy) NSString *title;
Set Title
@property (nonatomic) Uiactionsheetstyle Actionsheetstyle;
To set the style, enumerate the following:
?
123456 |
typedef < Code class= "CPP Plain" >ns_enum (nsinteger, uiactionsheetstyle) { uiactionsheetstyleautomatic = -1, uiactionsheetstyledefault = uibarstyledefault, &NBSP;&NBSP;&NBSP;&NBSP; Code class= "CPP Plain" >uiactionsheetstyleblacktranslucent = uibarstyleblacktranslucent, &NBSP;&NBSP;&NBSP;&NBSP; uiactionsheetstyleblackopaque = uibarstyleblackopaque, }; |
-(Nsinteger) Addbuttonwithtitle: (NSString *) title;
Add a button that returns the index of the button
-(NSString *) Buttontitleatindex: (Nsinteger) Buttonindex;
Get button title
@property (nonatomic,readonly) Nsinteger numberofbuttons;
Get the number of buttons
@property (nonatomic) Nsinteger Cancelbuttonindex;
Set the index value of the Cancel button
@property (nonatomic) Nsinteger Destructivebuttonindex;
Set Special tags
@property (nonatomic,readonly,getter=isvisible) BOOL visible;
Whether the view is currently visible
Here are a few pop-up methods that show different ways depending on style
-(void) Showfromtoolbar: (Uitoolbar *) view;
-(void) Showfromtabbar: (Uitabbar *) view;
-(void) Showfrombarbuttonitem: (Uibarbuttonitem *) Item animated: (BOOL) animated;
-(void) Showfromrect: (cgrect) rect inview: (UIView *) View animated: (BOOL) animated;
-(void) Showinview: (UIView *) view;
-(void) Dismisswithclickedbuttonindex: (Nsinteger) Buttonindex animated: (BOOL) animated;
Use code to retract a view
Three, Uiactionsheet agent method
-(void) Actionsheet: (Uiactionsheet *) Actionsheet Clickedbuttonatindex: (Nsinteger) Buttonindex;
How to trigger when a button is clicked
-(void) Willpresentactionsheet: (Uiactionsheet *) Actionsheet;
The method that fires when the view is about to pop up
-(void) Didpresentactionsheet: (Uiactionsheet *) Actionsheet;
How the view has been triggered by pop-up
-(void) Actionsheet: (Uiactionsheet *) Actionsheet Willdismisswithbuttonindex: (Nsinteger) Buttonindex;
The method that fires when the view is retracted when the button is clicked
-(void) Actionsheet: (Uiactionsheet *) Actionsheet Diddismisswithbuttonindex: (Nsinteger) Buttonindex;
Method triggered when the view has been retracted when the button is clicked
How to use Uialertview and Uiactionsheet (prompting the user)