iOS opening--ui ualertview (cue box)

Source: Internet
Author: User

Create a prompt box

 //  Create a hint box     Uialertview  * Alertview = [[Uialertview alloc]initwithtitle:@ '   warning   " message:@"   Saddam's ready to fight.   delegate : Self Cancelbuttontitle:@ "  cancel   " Otherbuttontitles:@"   OK   ", @"   Not sure  , nil]; 

Set the Cue box style

    Alertview. Alertviewstyle = uialertviewstyleplaintextinput;     /*      typedef ns_enum (Nsinteger, Uialertviewstyle) {     Uialertviewstyledefault = 0,     Uialertviewstylesecuretextinput,   ciphertext input     uialertviewstyleplaintextinput,    plaintext input     Uialertviewstyleloginandpasswordinput  Clear text + ciphertext     } __tvos_prohibited     ; */

Let Alertview show it.

[Alertview show];

To set the proxy implementation Protocol method

Alertview. delegate = self;
#pragmamark-uialertviewdelegate-(void) Alertview: (Uialertview *) Alertview Clickedbuttonatindex: (nsinteger) buttonindex{if(Buttonindex = =0) {NSLog (@"Click the Cancel"); NSLog (@"%@", [Alertview Textfieldatindex:0].text); }Else{NSLog (@"clicked OK."); }}

It is not recommended to use after iOS9

Uialertcontroller+uialertcontrollerstylealert can also achieve the same function

iOS opening--ui ualertview (cue box)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.