Tuesday, December 17, 2013

Help, I ask the input method pop-up, the view is playing up how to do?

Such as the title, just like that fetion iPhone client login screen when the cursor is the focal point in the input box when the input method pop-up, then the login screen the entire view on up shells, so the input method does not cover the text box to enter. Great forum to ask God for them, this is how to do? I pull up a text box below the view, the input method on the cover of a pop, neighborhoods under you, how it can not cover. . .
Reply:
- (Void) textFieldDidBeginEditingUITextField *) textField

{

[Self animateTextField: textField up: YES];

}
- (Void) textFieldDidEndEditingUITextField *) textField

{

[Self animateTextField: textField up: NO];

}
- (Void) animateTextField: (UITextField *) textField up: (BOOL) up

{

const int movementDistance = 80; / / tweak as needed

const float movementDuration = 0.3f; / / tweak as needed



int movement = (up-movementDistance:? movementDistance);



[UIView beginAnimations: @ "anim" context: nil];

[UIView setAnimationBeginsFromCurrentState: YES];

[UIView setAnimationDuration: movementDuration];

self.view.frame = CGRectOffset (self.view.frame, 0, movement);

[UIView commitAnimations];

}
Reply:
Simple words, adjust view of the frame
Reply:
I have often encountered this happen, I usually use ScrollView, think how much
shift Transferred[ScrollView setContentSize: CGSizeMake (x, y)];
(X, y) coordinates to the mobile
Simply Editing Did Begin to trigger on it
Reply:
The problem has been solved by the scollerview Thank you

No comments:

Post a Comment