Skip to content
Browse files

Making some small fixes to the demo app for iPhone 5

  • Loading branch information...
1 parent 18e3698 commit e6b281850d8189cff69839b3e2be123a812a7cbc @gotosleep committed Feb 10, 2013
View
15 JASidePanels/Demo/JACenterViewController.m
@@ -31,21 +31,20 @@ @interface JACenterViewController ()
@implementation JACenterViewController
+- (id)init {
+ if (self = [super init]) {
+ self.title = @"Center Panel";
+ }
+ return self;
+}
+
- (void)viewDidLoad {
[super viewDidLoad];
CGFloat red = (CGFloat)arc4random() / 0x100000000;
CGFloat green = (CGFloat)arc4random() / 0x100000000;
CGFloat blue = (CGFloat)arc4random() / 0x100000000;
self.view.backgroundColor = [UIColor colorWithRed:red green:green blue:blue alpha:1.0f];
-
- UILabel *label = [[UILabel alloc] init];
- label.font = [UIFont boldSystemFontOfSize:20.0f];
- label.text = @"Center Panel";
- [label sizeToFit];
- label.center = CGPointMake(floorf(self.view.bounds.size.width/2.0f), floorf((self.view.bounds.size.height - self.navigationController.navigationBar.frame.size.height)/2.0f));
- label.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin;
- [self.view addSubview:label];
}
@end
View
12 JASidePanels/Demo/JALeftViewController.m
@@ -54,12 +54,12 @@ - (void)viewDidLoad {
label.backgroundColor = [UIColor clearColor];
label.text = @"Left Panel";
[label sizeToFit];
- label.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin;
+ label.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin;
[self.view addSubview:label];
self.label = label;
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
- button.frame = CGRectMake(20.0f, 20.0f, 200.0f, 40.0f);
+ button.frame = CGRectMake(20.0f, 70.0f, 200.0f, 40.0f);
button.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;
[button setTitle:@"Hide Center" forState:UIControlStateNormal];
[button addTarget:self action:@selector(_hideTapped:) forControlEvents:UIControlEventTouchUpInside];
@@ -76,7 +76,7 @@ - (void)viewDidLoad {
self.show = button;
button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
- button.frame = CGRectMake(20.0f, 70.0f, 200.0f, 40.0f);
+ button.frame = CGRectMake(20.0f, 120.0f, 200.0f, 40.0f);
button.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;
[button setTitle:@"Remove Right Panel" forState:UIControlStateNormal];
[button addTarget:self action:@selector(_removeRightPanelTapped:) forControlEvents:UIControlEventTouchUpInside];
@@ -93,7 +93,7 @@ - (void)viewDidLoad {
self.addRightPanel = button;
button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
- button.frame = CGRectMake(20.0f, 245.0f, 200.0f, 40.0f);
+ button.frame = CGRectMake(20.0f, 170.0f, 200.0f, 40.0f);
button.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
[button setTitle:@"Change Center Panel" forState:UIControlStateNormal];
[button addTarget:self action:@selector(_changeCenterPanelTapped:) forControlEvents:UIControlEventTouchUpInside];
@@ -103,7 +103,7 @@ - (void)viewDidLoad {
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
- self.label.center = CGPointMake(floorf(self.sidePanelController.leftVisibleWidth/2.0f), floorf(self.view.bounds.size.height/2.0f));
+ self.label.center = CGPointMake(floorf(self.sidePanelController.leftVisibleWidth/2.0f), 25.0f);
}
#pragma mark - Button Actions
@@ -133,7 +133,7 @@ - (void)_addRightPanelTapped:(id)sender {
}
- (void)_changeCenterPanelTapped:(id)sender {
- self.sidePanelController.centerPanel = [[JACenterViewController alloc] init];
+ self.sidePanelController.centerPanel = [[UINavigationController alloc] initWithRootViewController:[[JACenterViewController alloc] init]];
}
@end
View
4 JASidePanels/Demo/JARightViewController.m
@@ -40,7 +40,7 @@ - (void)viewDidLoad {
self.view.backgroundColor = [UIColor redColor];
self.label.text = @"Right Panel";
[self.label sizeToFit];
- self.hide.frame = CGRectMake(self.view.bounds.size.width - 220.0f, 20.0f, 200.0f, 40.0f);
+ self.hide.frame = CGRectMake(self.view.bounds.size.width - 220.0f, 70.0f, 200.0f, 40.0f);
self.hide.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin;
self.show.frame = self.hide.frame;
self.show.autoresizingMask = self.hide.autoresizingMask;
@@ -52,7 +52,7 @@ - (void)viewDidLoad {
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
- self.label.center = CGPointMake(floorf((self.view.bounds.size.width - self.sidePanelController.rightVisibleWidth) + self.sidePanelController.rightVisibleWidth/2.0f), floorf(self.view.bounds.size.height/2.0f));
+ self.label.center = CGPointMake(floorf((self.view.bounds.size.width - self.sidePanelController.rightVisibleWidth) + self.sidePanelController.rightVisibleWidth/2.0f), 25.0f);
}
@end

0 comments on commit e6b2818

Please sign in to comment.
Something went wrong with that request. Please try again.