ios - UIAlertView UITextField showing black border -
i creating uialertview textinput, though clear background , giving border colour showing black border.
uialertview *alerttorename=[[uialertview alloc]initwithtitle:@"dropbox export" message:@"export as:" delegate:projectdetailsreference cancelbuttontitle:nil otherbuttontitles:@"ok", nil]; alerttorename.alertviewstyle = uialertviewstyleplaintextinput; [[alerttorename textfieldatindex:0] settext:[appdelegate.projectname stringbydeletingpathextension]]; uitextfield *textfield = [alerttorename textfieldatindex:0]; [textfield setbackgroundcolor:[uicolor clearcolor]]; textfield.borderstyle=uitextborderstyleroundedrect ; textfield.layer.bordercolor=[[uicolor lightgraycolor]cgcolor]; textfield.layer.borderwidth = 0.1f; textfield.layer.cornerradius = 5; textfield.clipstobounds = yes; alerttorename.tag=233; [alerttorename show];
refer example, uialertcontroller :
uialertcontroller *alertcontroller = [uialertcontroller alertcontrollerwithtitle:alerttitle message:alertmessage preferredstyle:uialertcontrollerstylealert]; [alertcontroller addtextfieldwithconfigurationhandler:^(uitextfield *textfield) { textfield.placeholder = nslocalizedstring(@"loginplaceholder", @"login"); }]; [alertcontroller addtextfieldwithconfigurationhandler:^(uitextfield *textfield) { textfield.placeholder = nslocalizedstring(@"passwordplaceholder", @"password"); textfield.securetextentry = yes; }];
the values of text field can retrieved in ok action handler:
uialertaction *okaction = [uialertaction actionwithtitle:nslocalizedstring(@"ok", @"ok action") style:uialertactionstyledefault handler:^(uialertaction *action) { uitextfield *login = alertcontroller.textfields.firstobject; uitextfield *password = alertcontroller.textfields.lastobject; }];
for more info uialertcontroller, refer link.
Comments
Post a Comment