0

私は次のコードを持っています:

   PNRProfileViewController *vc = [[PNRProfileViewController alloc] initWithNibName:@"PNRProfileViewController" bundle:nil];
    vc.delegate = self;
    self.profileVC_ = vc;

    UINavigationController *controller = [[UINavigationController alloc] initWithRootViewController:self.profileVC_];
    AHLog(@"FRAME IS %@", NSStringFromCGRect(self.profileVC_.view.frame));
    controller.view.frame = self.profileVC_.view.frame;
    controller.view.autoresizingMask = self.profileVC_.view.autoresizingMask;

    self.currentViewController_ = controller;

このコードを実行すると、取得したフレームの高さが毎回変化します。416と460が交互に表示されます。これがなぜなのかわかりません。どんな手掛かり?

4

1 に答える 1

1

44 ピクセルは、ナビゲーション バーの高さです。

ナビゲーション バーを保持し、ペン先のサイズを尊重するには、.xib ファイルに移動し、ビューを選択してから、属性タブで、タブ バーのドロップダウンをナビゲーション バーに設定します。

ナビゲーション バーを削除するには、NavigationController 呼び出しを割り当てた後controller.navigationBarHidden = YES;

于 2012-09-12T20:19:24.727 に答える