2012-04-27 17 views
0

これは私が今までに見たiOS開発で最も奇妙な問題です。私はiOS開発には比較的新しいので、何か明白でないか、私の用語が完全に正しくない場合はお詫びします。明確化が必要な場合は、コメントに私に教えてください。私はそれに応じて私の質問を編集します。非常に奇妙なIOSオリエンテーションの問題がThree20で発生する

問題

それはそれとは何かを持っているかもしれないので、私は、Three20を使用しています。しかし、私は基本的には他のビュー(下の画像に示す)にリンクする一連の画像である「ホームビュー」を持っています。私が肖像画の視点から始めれば、すべてが順調です。

enter image description here

次のビューは、以下に示すテーブルビュー、次のとおりです。

enter image description here

YAY!私は回転することができ、すべては世界で正しいです。 BUT私はその家の景色に戻って、景色に回転し、次にこのタップ付きの景色に行くと、世界が壊れます。

enter image description here

あなたは今私の表の右側に追加され、ランダムなスペースがあることがわかります。私はどこからどのように来たのか分かりません。ここに私のController.mファイルがあります:

#import "FriendTabsController.h" 
#import "MyAppApp.h" 
#import "JohnDoeManager.h" 

@implementation FriendTabsController 

@synthesize innerView, segmentedControl, innerController, friendsController, friendRequestsController; 

- (void)addBottomGutter:(UIViewController*)controller { 
    if ([controller isKindOfClass:[TTTableViewController class]]) { 
    TTTableViewController* tableViewController = (TTTableViewController*)controller; 
    tableViewController.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(0,0,50+44,0); 
    tableViewController.tableView.contentInset = UIEdgeInsetsMake(0,0,50+44,0); 
    } 
} 

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {  
    return YES; 
} 

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 
- (void)viewDidLoad { 
    [super viewDidLoad]; 

    self.title = @"Friends"; 
    self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque; 
    self.navigationController.navigationBar.tintColor = nil; 


    friendsController = [[FriendsController alloc] init]; 
    friendRequestsController = [[FriendsController alloc] init]; 
    ((FriendsController*)friendRequestsController).friendRequests = YES; 

    [self addBottomGutter:friendsController]; 
    [self addBottomGutter:friendRequestsController]; 

    innerController = friendsController; 
    [innerView addSubview:innerController.view]; 
    [innerController viewDidLoad]; 

    UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; 
    [self loadBannerAd:(orientation)]; 

} 
-(void) loadBannerAd:(UIInterfaceOrientation)orientation{ 

    MainLayer *mi = [MainLayer getInstance]; 
    if (mi.useJohnDoeAds) { 
    [[JohnDoeManager sharedInstance] setCurrentViewController:self]; 
    [mi.JohnDoeBanner.view removeFromSuperview]; 

     if(orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) { 
      // This is a portait ad 
      if ([[MyAppUtils getCurrentDevice] isEqualToString:@"iphone"]) { 
       [mi.JohnDoeBanner setFrame:CGRectMake(0, 410-44, 320, 50)]; 
      }else{ 
       [mi.JohnDoeBanner setFrame:CGRectMake(0, 1024-44-90-20, 768, 90)]; 
      }     
     } else { 
      // Landscape 
      if ([[MyAppUtils getCurrentDevice] isEqualToString:@"iphone"]) { 
       [mi.JohnDoeBanner setFrame:CGRectMake(0, 320-44-58, 410, 50)]; 
      }else{ 
       [mi.JohnDoeBanner setFrame:CGRectMake((1024-768)/2, 768-44-90-20, 768, 90)]; 
      }    
     } 

     [self.view addSubview:mi.JohnDoeBanner.view]; 
      [mi.JohnDoeBanner rollOver];   
    } 
} 

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { 
    [self loadBannerAd:(toInterfaceOrientation)]; 
} 


- (IBAction)didChangeSegment:(UISegmentedControl *)control { 
    if (innerController) { 
    [innerController viewWillDisappear:NO]; 
    [innerController.view removeFromSuperview]; 
    [innerController viewDidDisappear:NO]; 
    } 

    switch (control.selectedSegmentIndex) { 
    case 0: 
     innerController = friendsController; 
     self.title = @"Friends"; 

     break; 
    case 1: 
     innerController = friendRequestsController; 
     self.title = @"Requests"; 

     break; 
    } 
    [innerController viewWillAppear:NO]; 
    [innerView addSubview:innerController.view]; 
    [innerController viewDidAppear:NO]; 
} 

- (void)viewWillAppear:(BOOL)animated { 
    [super viewWillAppear:animated]; 
    [innerController viewWillAppear:animated]; 
    self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque; 
    self.navigationController.navigationBar.tintColor = nil; 
} 

- (void)viewDidAppear:(BOOL)animated { 
    [super viewDidAppear:animated]; 
    [innerController viewDidAppear:animated]; 
} 

- (void)viewWillDisappear:(BOOL)animated { 
    [innerController viewWillDisappear:animated]; 
    [super viewWillDisappear:animated]; 
} 

- (void)viewDidDisappear:(BOOL)animated { 
    [innerController viewDidDisappear:animated]; 
    [super viewDidDisappear:animated]; 
} 

- (void)didReceiveMemoryWarning { 
    [super didReceiveMemoryWarning]; 
} 

- (void)viewDidUnload { 
    [friendsController release], friendsController = nil; 
    [friendRequestsController release], friendRequestsController = nil; 
    [super viewDidUnload]; 
} 

- (void)dealloc { 
    [super dealloc]; 
} 


@end 

誰かが何が起こっているのか教えてください。助けて!

答えて

2

wishFullScreenLayoutプロパティをYESに設定する必要があります。あなたのinitメソッドで

self.wantsFullScreenLayout = YES; 

これはあなたの問題を解決するに設定します。

関連する問題