0
嗨,有人可以幫助解決這個問題。我需要以編程方式向UIView添加UItabbar。這是下面的代碼,應用程序從一開始RootViewTableController,然後被髮布到這個觀點,但標籤不工作,也許它的東西在MainWindow.xib中這就是問題所在?:以編程方式添加UITabBarController和UITabs
// TabBarController.h
@interface TabBarController : UITabBarController
@end
// TabBarController.m
#import "TabBarController.h"
#import "FirstV.h"
@implementation TabBarController
-(void)viewDidLoad {
NSMutableArray *listOfViewControllers = [[NSMutableArray alloc] init];
UIViewController *vc;
vc = [[UIViewController alloc] init];
vc.title = @"A";
[listOfViewControllers addObject:vc];
[vc release];
vc = [[UIViewController alloc] init];
vc.title = @"B";
[listOfViewControllers addObject:vc];
[vc release];
[self.tabBarController setViewControllers:listOfViewControllers animated:YES];
[super viewDidLoad];
}
@end
截屏在這裏: i.stack.imgur.com/JsuuW.png
正如你在底部看不到標籤,我應該拖放一個UItabbar元素到視圖中嗎?