iphone - How to stop the UIView from disappearing? -



iphone - How to stop the UIView from disappearing? -

by clicking on button, save info uitextfields of uiview. when info in uitextfield not right , click on button, want open keyboard, view dissapears. how stop uiview dissapearing , open keyboard instead.

i think should set code in viewshoulddissapear, there no such method.

this code:

- (void) viewwilldisappear:(bool)animated { if ([textfield1 length] < 3 || [textfield1 length] > 17) { tableview.contentinset = uiedgeinsetsmake(65, 0, 10, 0); [tableview scrolltorowatindexpath:[nsindexpath indexpathforrow:7 insection:indexpath.section] atscrollposition:uitableviewscrollpositiontop animated:no]; [txtseriesasiu becomefirstresponder]; return; } if (shouldsave) [self save]; }

i'm assuming have button on navigation controller. then add together custom button there , if right dismiss other wise show keyboard

- (void)viewdidload { [super viewdidload]; uibutton *button = [uibutton buttonwithtype:uibuttontypecustom]; [button setimage:[uiimage imagenamed:@"goback.png"] forstate:uicontrolstatenormal]; [button addtarget:self action:@selector(popvc:) forcontrolevents:uicontroleventtouchupinside]; [button setframe:cgrectmake(0, 0, 32, 32)]; self.navigationitem.leftbarbuttonitem = [[uibarbuttonitem alloc] initwithcustomview:button]; } - (void)popvc:(id)sender { if (isvaluecorrect) { [self.navigationcontroller popviewcontrolleranimated:yes]; } else{ [textview becomefirstresponder]; } }

iphone uiview keyboard viewwillappear

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -