- (Void) textFieldDidBeginEditing: (UITextField *) textField inside to create a view, which then creates a new above textView, allows users textField input, right after my results to textField. But when I create a view and addSubView, found below the View or activities that a user may click on the space below, how should shield it? The best you can to make the new view is translucent, is that you can see the contents of the back view but can not operate.
Effect is shown, label is behind the view of space, you do not want users to be able to operate above ceshi is
textView
Reply:
There are many online solutions. With notification. Can also be used with scrollview view of annimation
Reply:
Not so troublesome. Just register two notifications when the keyboard appears when moving upward view (guaranteed UITextField not blocked), the keyboard disappear when moving down view to its original position.
- (Void) viewWillAppear: (BOOL) animated
{
[Super viewWillAppear: YES];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @ selector (keyboardWillShow :) name: UIKeyboardWillShowNotification object: nil];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @ selector (keyboardWillHide :) name: UIKeyboardWillHideNotification object: nil];
}
- (Void) viewWillDisappear: (BOOL) animated
{
[Super viewWillDisappear: YES];
[[NSNotificationCenter defaultCenter] removeObserver: self name: UIKeyboardWillShowNotification object: nil];
[[NSNotificationCenter defaultCenter] removeObserver: self name: UIKeyboardWillHideNotification object: nil];
}
- (Void) keyboardWillShow: (NSNotification *) aNotification
{
NSTimeInterval animationDuration =
[[[ANotification userInfo] objectForKey: UIKeyboardAnimationDurationUserInfoKey] doubleValue];
[UIView beginAnimations: @ "ResizeForKeyboard" context: nil];
[UIView setAnimationDuration: animationDuration];
self.view.center = CGPointMake (160, 180);
[UIView commitAnimations];
}
- (Void) keyboardWillHide: (NSNotification *) aNotification
{
NSTimeInterval animationDuration =
[[[ANotification userInfo] objectForKey: UIKeyboardAnimationDurationUserInfoKey] doubleValue];
[UIView beginAnimations: @ "ResizeForKeyboard" context: nil];
[UIView setAnimationDuration: animationDuration];
self.view.center = CGPointMake (160, 240);
[UIView commitAnimations];
}
Reply:
I have no points to post, seeking a ride down ocf, epub, mobi format e-books and software production methods introduced
Reply:
Not so much trouble, you can directly use it is a good idea, in fact I was trying to package a class, after having this occurs. So I want to ask why I kind of approach does not work?
No comments:
Post a Comment