Created
April 15, 2013 15:56
-
-
Save seanhess/5389139 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I had to set the navigation bar to hidden, then add the top and bottom controls as a view. | |
// I don't think you can control the navigation bar directly. | |
- (void)viewDidLoad { | |
[self.navigationController setNavigationBarHidden:YES animated:NO]; | |
} | |
- (void)showControls { | |
[UIView animateWithDuration:0.2 animations:^{ | |
CGRect bottomFrame = self.bottomControlsView.frame; | |
bottomFrame.origin.y = self.view.frame.size.height - bottomFrame.size.height; | |
self.bottomControlsView.frame = bottomFrame; | |
CGRect topFrame = self.topControlsView.frame; | |
topFrame.origin.y = 0; | |
self.topControlsView.frame = topFrame; | |
}]; | |
} | |
- (void)hideControls { | |
[UIView animateWithDuration:0.2 animations:^{ | |
CGRect bottomFrame = self.bottomControlsView.frame; | |
bottomFrame.origin.y = self.view.frame.size.height; | |
self.bottomControlsView.frame = bottomFrame; | |
CGRect topFrame = self.topControlsView.frame; | |
topFrame.origin.y = -topFrame.size.height; | |
self.topControlsView.frame = topFrame; | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment