【发布时间】:2011-09-01 14:47:24
【问题描述】:
您好,我有一个带有 5 个 tabBar 项目的 UITabBarController。 第四个是UIScrollView。
第四个标签显示的区域我不会有特定的高度。
所以直到这里我已经完成了这个
这是我创建我的 UITabBarController.(aViewController.h)
@interface aViewController: UIViewController <UITabBarControllerDelegate>{
UITabBarController *newTabBarController;
UIView *myView;
}
aViewController.m
- (void) viewDidLoad{
newTabBarController = [[UITabBarController alloc]init];
newTabBarController.delegate = self;
myView = [[UIView alloc]initWithFrame:CGRectMake(0,0,320,self.view.frame.size.height - newTabBarController.tabBar.frame.size.height)];
NSArray *controllers = [NSArray arrayWithObjects:myView, nil];
newTabBarController.viewControllers = controllers; //this is the line that a get an error :Tread1:Program receive signal: SIGABRT
[myView release];
}
如果我使用 Xcode 创建 UIViewController 的 viewController 子类并将其放入 NSArray 中没有问题,但我希望我的视图具有 screen.height - tabbar.height 所以我尝试以编程方式制作一个。 任何帮助!
【问题讨论】: