Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)keyboardWillShow:(NSNotification *)note {
- [UIView beginAnimations:nil context:NULL];
- [UIView setAnimationDuration:0.3];
- [UIView commitAnimations];
- CGRect r = self.loginToolbar.frame, t;
- [[note.userInfo valueForKey:UIKeyboardBoundsUserInfoKey] getValue: &t];
- r.origin.y -= t.size.height;
- self.loginToolbar.frame = r;
- }
- - (void)keyboardWillHide:(NSNotification *)note {
- CGRect r = self.loginToolbar.frame, t;
- [[note.userInfo valueForKey:UIKeyboardBoundsUserInfoKey] getValue: &t];
- r.origin.y -= t.size.height;
- self.loginToolbar.frame = r;
- [UIView beginAnimations:nil context:NULL];
- [UIView setAnimationDuration:0.3];
- [UIView commitAnimations];
- }
- - (void)viewDidLoad {
- NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
- [nc addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
- [nc addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
- self.appDelegate = (ZoolooAppDelegate *)[[UIApplication sharedApplication] delegate];
- [super viewDidLoad];
- }
Add Comment
Please, Sign In to add comment