From bcbb03d6abd1ac575f3d7a54f0b7d932a72dca48 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Tue, 25 Dec 2012 18:21:31 -0500 Subject: Fixed rotation bug with iOS 6 and made highscores landscape --- Classes/Cart_CollectAppDelegate.m | 3 ++- Classes/HighscoreListController.m | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) (limited to 'Classes') diff --git a/Classes/Cart_CollectAppDelegate.m b/Classes/Cart_CollectAppDelegate.m index 25a2aa4..c92d231 100755 --- a/Classes/Cart_CollectAppDelegate.m +++ b/Classes/Cart_CollectAppDelegate.m @@ -114,7 +114,8 @@ [viewController setView:glView]; // make the View Controller a child of the main window - [window addSubview: viewController.view]; + [window setRootViewController:viewController]; + //[window addSubview: viewController.view]; [window makeKeyAndVisible]; diff --git a/Classes/HighscoreListController.m b/Classes/HighscoreListController.m index 7370da5..c746421 100755 --- a/Classes/HighscoreListController.m +++ b/Classes/HighscoreListController.m @@ -24,7 +24,7 @@ if (self) { localHighscores = [[Highscore localHighscoreListForGameMode:@"Collect"] retain]; - navigationBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)]; + navigationBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, 480, 44)]; myNavigationItem = [[UINavigationItem alloc] initWithTitle:@"Highscores"]; UIBarButtonItem* barButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(back)]; myNavigationItem.leftBarButtonItem = barButton; @@ -45,7 +45,7 @@ [modeControl addTarget:self action:@selector(switchGameMode:) forControlEvents:UIControlEventValueChanged]; UIBarButtonItem* barButton3 = [[UIBarButtonItem alloc] initWithCustomView:modeControl]; - toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 480-44, 320, 44)]; + toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 320-44, 480, 44)]; [toolbar setItems:[NSArray arrayWithObjects:barButton3, btnSpace, barButton2, nil] animated:NO]; [barButton2 release]; [btnSpace release]; @@ -55,8 +55,8 @@ loadingGlobal = NO; tableView = [(UITableView*)self.view retain]; - UIView* parentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; - [tableView setFrame:CGRectMake(0, 44, 320, 480-44-44)]; + UIView* parentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 480, 320)]; + [tableView setFrame:CGRectMake(0, 44, 480, 320-44-44)]; [parentView addSubview:navigationBar]; [parentView addSubview:tableView]; [parentView addSubview:toolbar]; @@ -101,9 +101,9 @@ */ /* // Override to allow orientations other than the default portrait orientation. -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - // Return YES for supported orientations. - return YES; +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return ( interfaceOrientation == UIInterfaceOrientationLandscapeRight ); } */ @@ -183,7 +183,7 @@ UILabel* scoreLabel = [[UILabel alloc] init]; scoreLabel.text = [NSString stringWithFormat:@"%d", highscore.score]; CGSize labelSize = [scoreLabel.text sizeWithFont:scoreLabel.font constrainedToSize:CGSizeMake(160, 44) lineBreakMode:UILineBreakModeClip]; - scoreLabel.frame = CGRectMake(320-10-labelSize.width, 22-labelSize.height/2, labelSize.width, labelSize.height); + scoreLabel.frame = CGRectMake(480-10-labelSize.width, 22-labelSize.height/2, labelSize.width, labelSize.height); [cell addSubview:scoreLabel]; [scoreLabel release]; @@ -293,10 +293,10 @@ { loadingGlobal = YES; - loadingView = [[UIView alloc] initWithFrame:CGRectMake(0, 44, 320, 480-44-44)]; - activity = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(150, 228-44, 20, 20)]; + loadingView = [[UIView alloc] initWithFrame:CGRectMake(0, 44, 480, 320-44-44)]; + activity = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(230, 148-44, 20, 20)]; activity.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray; - statusText = [[UILabel alloc] initWithFrame:CGRectMake(0, 256-44, 320, 21)]; + statusText = [[UILabel alloc] initWithFrame:CGRectMake(80, 150, 320, 21)]; statusText.text = @"Downloading highscores..."; statusText.textAlignment = UITextAlignmentCenter; -- cgit 1.4.1