navigationController
에 내 앱 기반을두고 있습니다. 그래서 도구 모음을 일부보기 및 다른 사람들을 위해 setToolbarHidden:NO
또는 YES
호출 한 didnt 설정할 표시합니다. 첫 번째 질문은 viewWillAppear
방법입니까?전체 앱용 iPhone 툴바
내 appDelegate
에서 툴바에 하나의 항목을 넣었지만 표시되지 않습니다. 다른 사람이 나를 보여줄 수 있습니까? 위임 프로토콜을 사용하여 항목을 눌렀을 때 각보기에서 무엇을해야하는지 어떻게 알 수 있습니까?
내 코드 : 사전에
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//create itemViewcontroller
EventosViewController *itemsViewController = [[EventosViewController alloc] init];
//create UINavigationcontroller, stack only contains itemviewcontroller
navController=[[UINavigationController alloc] initWithRootViewController:itemsViewController];
//navController will retain itemviewcontroller, we can release it
[itemsViewController release];
UIBarButtonItem *systemItem1 = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
target:self
action:@selector(pressButton1:)];
//Use this to put space in between your toolbox buttons
UIBarButtonItem *flexItem = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
target:nil
action:nil];
//Add buttons to the array
NSArray *items = [NSArray arrayWithObjects: systemItem1, flexItem,nil];
//release buttons
[systemItem1 release];
[flexItem release];
//add array of buttons to toolbar
[navController.toolbar setItems:items animated:NO];
//set navController's view in window hierarchy
[[self window] setRootViewController:navController];
[navController release];
// Override point for customization after application launch.
[self.window makeKeyAndVisible];
return YES;
}
들으!
같은 toolbaritems, 아니면 그냥 버튼을 계속 할 수 있습니까? – Mundi
그냥 버튼 –