When i press button textfield frame location should changed [ex: (0,0) to (50,50)]. That code work's perfectly. But if i try to type in textfield it's go back to same frame location [0,0]
and this is my code
(IBAction)Buttonname:(id)sender
{
CGRect newframeTextfield = textfiledname.frame;
newframeTextfield.origin.y = 365;
textfiledname.frame = newframeTextfield;
}
And this is previous position
-(void)viewWillAppear:(BOOL)animated
{
CGRect oldTextfieldframe = textfiledname.frame;
oldTextfieldframe.origin.y = 333;
oldTextfieldframe.origin.x = 50;
textfiledname.frame = oldTextfieldframe;
}
and i am also using scrollview and automatic textfield move up when keyboard appear.
-(void)textFieldDidBeginEditing:(UITextField *)textField
{
if (textField == textfiledname)
{
[Scrolview setContentOffset:CGPointMake(0, 210) animated:YES];
Scrolview.contentSize = CGSizeMake(320, 900); // there is submit button in bottom so scroll up to submit when keyboard appear. Otherwise (320,568) using in other function
}
}
and Advance Thanks... :)
Aucun commentaire:
Enregistrer un commentaire