내가의 도구 모음을 표시하려고 내 탐색 컨트롤러의 루트 뷰 컨트롤러의 초기화 방법 :왜이 UIToolBar가 나타나지 않습니까?
-(id) initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{
self = [super initWithNibName:nil bundle:nil];
if(self){
//GUI implementation
self.navigationController.toolbarHidden = NO;
UIBarButtonItem *flexiableItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:self
action:nil];
UIBarButtonItem *item1 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh
target:self
action:nil];
self.toolbarItems = [NSArray arrayWithObjects:flexiableItem, item1, nil];
UIBarButtonItem* addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
target:self
action:@selector(addEmployee)];
self.navigationItem.rightBarButtonItem = addButton;
self.navigationItem.leftBarButtonItem = self.editButtonItem;
}
return self;
}
을 여기에 애플 대리자 내 대표 application:DidFinishLaunching
방법 :
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
BOHomeViewController* hvc = [[BOHomeViewController alloc] initWithStyle:UITableViewStylePlain];
UINavigationController* navbar = [[UINavigationController alloc] initWithRootViewController:hvc];
[self.window setRootViewController:navbar];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
도구 모음이 전혀 표시되지 않습니다. 누군가 제가 잘못하고있는 것을 지적 할 수 있습니까? 매우 감사.
감사합니다. –