代碼:色調顏色不起作用
UIViewController *viewController = [[UIViewController alloc] initWithNibName:@"NibName" bundle:nil];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
navigationController.navigationBar.tintColor = [UIColor redColor];
self.popoverController = [[[UIPopoverController alloc]
initWithContentViewController:navigationController] autorelease];
popoverController.popoverContentSize = viewController.view.frame.size;
[popoverController presentPopoverFromRect:sender.frame inView:sender.superview
permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
[viewController release];
[navigationController release];
的UINavigationBar
着色顏色屬性不起作用,它仍然有默認的顏色。 我能做什麼錯?
在的viewController: 的NSLog(@ 「色調:%@」,self.navigationController.navigationBar.tintColor); self.navigationController.navigationBar.tintColor = [UIColor brownColor]; NSLog(@「Tint:%@」,self.navigationController.navigationBar.tintColor); 日誌: 色調:(null) 色調:UIDeviceRGBColorSpace 0.6 0.4 0.2 1 但視覺上的淺色不平衡。 –
這裏我有另一種解決方案很相似:http://stackoverflow.com/questions/8490261/change-color-navigation-controller-in-a-popover祝你好運! – TurboManolo