Permalink
Browse files

fixed some minor details

  • Loading branch information...
1 parent 6d80b12 commit 6f4958678d57d5e83eec79bb52651b228d54b4f9 Jonathan Penn committed Jan 8, 2014
Showing with 7 additions and 4 deletions.
  1. +7 −4 Dangle/Dangle/RCWViewController.m
@@ -9,6 +9,7 @@ @implementation RCWViewController
- (void)viewDidLoad
{
+ [super viewDidLoad];
UIView *ball = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
ball.center = CGPointMake(self.view.center.x + 150, 70);
ball.backgroundColor = [UIColor redColor];
@@ -84,15 +85,17 @@ - (void)keyboardDidShow:(NSNotification *)note
{
CGRect keyboardFrame = [(NSValue *)note.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
keyboardFrame = [self.view convertRect:keyboardFrame fromView:self.view.window];
- CGSize size = self.view.bounds.size;
- self.view.bounds = CGRectMake(0, 0, size.width, size.height - keyboardFrame.size.height);
+ CGRect viewFrame = self.view.frame;
+ viewFrame.size.height -= keyboardFrame.size.height;
+ self.view.frame = viewFrame;
}
- (void)keyboardWillHide:(NSNotification *)note
{
CGRect keyboardFrame = [(NSValue *)note.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
- CGSize size = self.view.bounds.size;
- self.view.bounds = CGRectMake(0, 0, size.width, size.height + keyboardFrame.size.height);
+ CGRect viewFrame = self.view.frame;
+ viewFrame.size.height += keyboardFrame.size.height;
+ self.view.frame = viewFrame;
}
@end

0 comments on commit 6f49586

Please sign in to comment.