Go
Alertview There are two buttons, the default is to make the left side cancel, and the right is the confirmation. Apple Habit ~
The properties of the Alertview can be set. [Alertview Setalertviewstyle:uialertviewstyleloginandpasswordinput]; <
Uialertview *alertview = [Uialertview alloc] initwithtitle:@ "Defaultalertview" message:@ "Defalut"
Delegate:self cancelbuttontitle:@ "Cancel"
otherbuttontitles:@ "OK", nil]; <
Show Alertview [Alertview show]; <
Proxy method
Click on the index indexed to the event, index starting from 0-(void) Alertview: (Uialertview *) Alertview Clickedbuttonatindex: (Nsinteger) Buttonindex This method is called after the end of the animation and the view is hidden-(void) Alertview: (Uialertview *) Alertview Diddismisswithbuttonindex: (Nsinteger Buttonindex This method is called before the animation starts and the view is hidden-(void) Alertview: (Uialertview *) Alertview Willdismisswit Hbuttonindex: (Nsinteger) Buttonindex before view is going to be canceled-(void) Alertviewcancel: (Uialertview *) Alertview Called after the view is submitted to the user-(void) Didpresentalertview: (Uialertview *) Alertview
Setting yes/no will set the Enable property of the first Otherbutton of Alertview-(BOOL) Alertviewshouldenablefirstotherbutton (Uialertview *) Alertview
The order of the six delegate method calls is Alertviewshouldenablefirstotherbutton Willpresentalertview Didpresentalertview Clicke DbuttonatindexWilldismisswithbuttonindex(Alertviewcancel will be called if the view cancellation is triggered) Diddismisswithbuttonindex
ios4.0 after Alertview does not automatically remove the Alertview attribute 1.alertViewStyle as the program turns to the background: Bounce info and buttons Uialertviewstyledefault has a TextField encryption box UIAlertViewStyleSecureTextInput There is a non-encrypted textfielduialertviewstyleplaintextinput has two TextField, Login and passworduialertviewstyleloginandpasswordinput As long as there is TextField can be used Textfieldatindex to capture and do the appropriate actions such as the keyboard type 2.cancelbuttonindex Start is 0, if not set Cancel button is-1 3.delegate if not set is Nil 4.firstotherbuttonindex starting from 0, if not set is-1, and is not set will be ignored 5.message & nbsp Messages 6.numberofbuttons READ-only alertview button count 7.title title 8.visible read-only If yes indicates the display instance method return value is an increase of the button's index &NBSP ;-(Nsinteger) Addbuttonwithtitle: (NSString *) title input Buttonindex return button title -(NSString *) Buttontitleatindex: (nsinteger) Buttonindex Program Auto-Complete Click ButtoniNdex button and dismiss the entire Alertview operation -(void) Dismisswithclickedbuttonindex: (Nsinteger ) Buttonindex animated: (BOOL) animated to show that the Alertview must be called before the -(void) show return value is TextField- (uitext Field *) Textfieldatindex: (Nsinteger) Textfieldindexuialertviewstyledefault no Uialertviewstylesecureinput Textfieldindex only one for 0UIAlertViewStylePlainInput Textfieldindex only one for 0UIAlertViewStyleLoginAndPasswordInput Textfieldindex has two 0 1
iOS learning Note (iv) Alertview