iphone - How to add new UITextField to a custom UITableViewCell when return key pressed with animation -
for example in iphone contacts application,in add address cell, when user typing in "street" text field , text field place holder "street" add below current text field animation, how this?
add code:
- (bool) textfieldshouldreturn:(uitextfield *)textfield{ cgrect frame = textfield.frame; frame.origin.y = frame.origin.y + frame.size.height + 5;//5 space between 2 teftfields uitextfield *newtextfield =[[uitextfield alloc] initwithframe:frame]; textfield.placeholder = @"street"; [[textfield superview] addsubview:newtextfield]; return yes; }
for animation thinggy try tweaking around:
[uiview animatewithduration:(nstimeinterval) animations:^{  } completion:^(bool finished) {  }];
cheers.
Comments
Post a Comment