Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 有没有可能让Navigationtroller不全屏显示?_Iphone - Fatal编程技术网

Iphone 有没有可能让Navigationtroller不全屏显示?

Iphone 有没有可能让Navigationtroller不全屏显示?,iphone,Iphone,我有一个UIView(320*300是UIViewController的视图),我希望显示UINavigationCotroller并在这个视图大小内控制导航 可能吗 谢谢 interdev是。。你为什么认为不会呢?它可能是非标准的,但从技术上讲,它是可以做到的。下面,您将找到一段代码。但让我告诉你一句智慧的话不要这样做。不惜一切代价避免。苹果不建议这样做。你会做恶梦,忙着修补边缘案例。它在3.x中运行得很好,在iOS4中,您必须处理很多特殊情况 - (void) _adjustViewCont

我有一个UIView(320*300是UIViewController的视图),我希望显示UINavigationCotroller并在这个视图大小内控制导航

可能吗

谢谢


interdev

是。。你为什么认为不会呢?它可能是非标准的,但从技术上讲,它是可以做到的。下面,您将找到一段代码。但让我告诉你一句智慧的话不要这样做。不惜一切代价避免。苹果不建议这样做。你会做恶梦,忙着修补边缘案例。它在3.x中运行得很好,在iOS4中,您必须处理很多特殊情况

- (void) _adjustViewControllerforTicker {
 TickerView* vv = [ApplicationContext getTickerView];
if ([PreferenceDataModel isTickerOn]&& self.navigationController.view.frame.origin.y==0) {

    CGRect tableRect = self.tableView.frame;
    self.tableView.frame = CGRectMake(tableRect.origin.x,tableRect.origin.y, tableRect.size.width, tableRect.size.height -20);
    UINavigationController *nav = self.navigationController;
    CGRect gframe = CGRectOffset(self.navigationController.view.frame, 0, 20);
    self.navigationController.view.frame = gframe;
    if (!vv) {
        vv = [[TickerView alloc] initWithFrame:CGRectMake(0, 0, 480, 20)];

        [nav.view addSubview:vv];
        [vv release];
        self.tableView.contentInset=UIEdgeInsetsMake(0,0,20.0,0.0);
    }
}   
if (![PreferenceDataModel isTickerOn]) {
    self.tableView.contentInset= UIEdgeInsetsZero;
    if (vv){
        [vv removeFromSuperview];
        vv=nil;
    }
}

}

UINavigationController*导航控制器=[[UINavigationController alloc]initWithRootViewController:myViewController];导航控制器=导航控制器;navController.navigationItem.title=@“abc”;[自我呈现ModalViewController:navController动画:否];以上是我的密码。MyViewController.view大小为320*300,但不幸的是,navController仍然显示为全屏