模態推出 tableView 時不使其全屏

方法.  下面再墊一個 ViewController


    MenusTVC *menu = [[MenusTVC alloc]init];//要推出的控制器
    UIViewController *viewc = [[UIViewController alloc]init];// 襯底用的控制器
    viewc.view.backgroundColor = [UIColor whiteColor];
    CGFloat width = [[UIScreen mainScreen]bounds].size.width;//屏幕等寬
    CGFloat height = [[UIScreen mainScreen]bounds].size.height;//屏幕等高
    menu.view.frame = CGRectMake(0, 64, width, height-64);
    [viewc.view addSubview:menu.view];
    [viewc addChildViewController:menu];
    [self presentViewController:viewc animated:YES completion:nil];
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章