iphone - how to stretch a UITextField on begin editng -
i want increase size of uitextfield when editing begins, cant code it.
gomathi correct. add answer if want textfield expand when editing begins , shrink again when editing ends , want animate it, might wanna this:
- (bool)textfieldshouldbeginediting:(uitextfield *)textfield { [uiview animatewithduration:0.5 animations:^{ textfield.frame = cgrectmake(textfield.frame.origin.x-20, textfield.frame.origin.y, textfield.frame.size.width+40, textfield.frame.size.height); }]; return yes; } - (bool)textfieldshouldreturn:(uitextfield *)textfield { [uiview animatewithduration:0.5 animations:^{ textfield.frame = cgrectmake(textfield.frame.origin.x+20, textfield.frame.origin.y, textfield.frame.size.width-40, textfield.frame.size.height); }]; [textfield resignfirstresponder]; return yes; }
Comments
Post a Comment