1

UITabBarController最初の最初のビューがUIViewController下に約 20 ピクセルずれているという意味で、私は問題を抱えています。タブを移動したり、最初のView Controller(同じインスタンス、解放されていない)に戻ったりするたびに、問題ありません。初対面だけです。

私の手順:

  1. を割り当てて初期化していますUITabBarController
  2. の3つのインスタンスを割り当てて初期化していますUIViewController
  3. viewControllers上記の3つのアイテムの配列にプロパティを設定しています

私のコード:

- (void)viewDidLoad {
    [super viewDidLoad];
    // Allocate and initialize view controllers
    self.debtsViewController = [[DebtsViewController alloc] init];
    self.debtsViewController.title = NSLocalizedString(@"Debts", nil);
    self.debtsViewController.tabBarController = self;
    self.conclusionsViewController = [[ConclusionsViewController alloc] init];
    self.conclusionsViewController.title = NSLocalizedString(@"Entries", nil);
    self.conclusionsViewController.tabBarController = self;
    self.settingsViewController = [[SettingsViewController alloc] init];
    self.settingsViewController.title = NSLocalizedString(@"Settings", nil);
    // Assign to tabBarController
    self.viewControllers = [NSArray arrayWithObjects:self.debtsViewController, self.conclusionsViewController, self.settingsViewController, nil];
}

何か案は?

スクリーンショット: http://cl.ly/image/2E0S001d0Q2x ( のすぐ上の黒いスペースに注意してくださいUITableViewController)

4

2 に答える 2

0

スクリーンショットを一目見ただけで、実際には 3UINavigationControllersの中にUITabBarViewController. それらのナビゲーション バーは (ほぼ) 似ていますが、3 つの別個のインスタンスになります。「Settings」と「Debts」の共通点は何ですか? なぜ同じナビゲーションを共有するのでしょうか?

使用のポイントはUITabBarViewController、アプリの独立したセクションを持つことです。Apple のガイドを強くお勧めします。

于 2013-03-25T21:34:59.300 に答える