我在 UIViewController 中制作了一个 UIScrollView 。现在我想向它添加一个 UITabBarController 。但是当我这样做时,我看不到添加到它的 TabBarController ..
我写了这段代码
[testscroll setScrollEnabled:YES];
[testscroll setContentSize:CGSizeMake(320,800)];
FirstViewController *first = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
first.title=@"Search";
UserProfile *second=[[UserProfile alloc]initWithNibName:@"UserProfile" bundle:nil];
second.title=@"My Profile";
UserActivities *third=[[UserActivities alloc]initWithNibName:@"UserActivities" bundle:nil];
third.title=@"My Activities";
LogOut *logout=[[LogOut alloc]initWithNibName:@"LogOut" bundle:nil];
logout.title=@"Sign Out";
NSArray *viewArray= [NSArray arrayWithObjects:first,second,third,logout, nil];
tabBarController=[[UITabBarController alloc] init];
[tabBarController setViewControllers:viewArray animated:NO];
[self presentModalViewController:tabBarController animated:NO];
我在第五个ViewController 中添加了这个。我可以看到添加了UIScrollView 和一些标签和文本字段,但没有添加TabBarController。我哪里出错了..?