uinavigationcontroller

Assertion failure while trying to pop views from the navigation stack

耗尽温柔 提交于 2019-12-22 20:04:05
问题 I'm trying to pop to a specific view controller that is in the navigation stack but I am doing something wrong as I am getting this error pop up when I try to execute the code Assertion failure in -[UINavigationController popToViewController:transition:], /SourceCache/UIKit_Sim/UIKit-1912.3/UINavigationController.m:2229 Here is the code thats causing the issue FirstViewController *firstViewController = [[FirstViewController alloc] initWithNibName:@"FirstViewController.xib" bundle:nil]; [self

Assertion failure while trying to pop views from the navigation stack

爷,独闯天下 提交于 2019-12-22 20:03:10
问题 I'm trying to pop to a specific view controller that is in the navigation stack but I am doing something wrong as I am getting this error pop up when I try to execute the code Assertion failure in -[UINavigationController popToViewController:transition:], /SourceCache/UIKit_Sim/UIKit-1912.3/UINavigationController.m:2229 Here is the code thats causing the issue FirstViewController *firstViewController = [[FirstViewController alloc] initWithNibName:@"FirstViewController.xib" bundle:nil]; [self

pushViewController with tableViewController in viewController

守給你的承諾、 提交于 2019-12-22 18:04:09
问题 I have an UIViewController, this controller is contained in a navigationController. I add an UITableViewController in this viewController. I would like to call a pushViewController method when I press on a cell of my tableView. I tried this : UITableViewController - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { FirstView *myViewController = [[FirstView alloc] init]; [f myViewController]; } UIViewController (FirstView) -(void)pushIt { SecondView

Use Background Image to UINavigationController among multiple views

。_饼干妹妹 提交于 2019-12-22 13:56:49
问题 How can I use a background image for UINavigationController, while maintaining the title? The answer from ck on other thread did the trick to put the image and keep the text. But if the user navigates to other view ( using [navigationController pushViewController]), only the background appears in the new screen. How can one change the background image for UINavigationController, while maintaining the title across multiple views? 回答1: create a CustomUIViewController that extends

UIBarButtonItems not showing up on UIToolbar

∥☆過路亽.° 提交于 2019-12-22 13:10:24
问题 I have a UINavigationController with toolbarHidden set to NO. I have added UIBarButtonItems to navigationController.toolbar. The toolbar is displayed, but the buttons are not... What gives? 回答1: Ok so apparently I misunderstood the usage of the setItems method on navigationController. To remedy this I set the toolbar items on each view controller that is pushed onto the navigation controller's stack. I guess if I wanted to have one toolbar persist through all the views I could add a new

iOS hidesBarsOnSwipe status bar background color

霸气de小男生 提交于 2019-12-22 11:33:57
问题 When I swipe and hide the navigation bar with the hidesBarsOnSwipe property the status bar has a clear background. How can I set the background of the status bar to the same color as the navigation bar? Here are a few pictures showing my problem, this is all contained in a UITableViewController . Separate Separate picture, looks like one big one. 回答1: I've come across the same issue, and was able to solve it. I'm fairly new to iOS dev, and I don't imagine this solution to be foolproof. I

How do I set custom navigation bar(title + titleView) for all navigation controllers and view controller?

倾然丶 夕夏残阳落幕 提交于 2019-12-22 09:39:39
问题 I have a tabbed application with navigation controllers in tabs and view controller in them. All of them use the same navigation controller navigation bar: back button + logo image. Currently, I'm placing this code in every view controller: - (void)viewDidLoad { [super viewDidLoad]; self.navigationItem.title = @"Back"; UIImage *headerImage = [UIImage imageNamed:@"Logo.png"]; self.navigationItem.titleView = [[[UIImageView alloc] initWithImage:headerImage] autorelease]; } IMHO it's not the best

iOS5 UINavigationBar background image issues when prompt is shown

徘徊边缘 提交于 2019-12-22 09:38:42
问题 I am using the new appearance proxy in iOS 5 to style my UINavigationBar with a background image. [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"ZSNavigationBG.png"] forBarMetrics:UIBarMetricsDefault]; [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"ZSNavigationLandscapeBG.png"] forBarMetrics:UIBarMetricsLandscapePhone]; This works fine, but I need to set the prompt property of the nav bar. When I do that, the height of the nav bar increases, and

Subclassing UINavigationBar in Swift

谁都会走 提交于 2019-12-22 08:42:12
问题 I'm trying to create a custom UINavigationBar class and then use the Storyboard to set it as the class of my UINavigationController 's NavigationBar. Here's the code of my UINavigationBar class: class CustomNavBar: UINavigationBar { override func drawRect(rect: CGRect) { super.drawRect(rect) // Drawing code self.backgroundColor = UIColor.orangeColor() let myLabel = UILabel(frame: CGRect(x: 0, y: 4, width: 600, height: 36)) myLabel.backgroundColor = UIColor.purpleColor() myLabel.textColor =

Subclassing UINavigationBar in Swift

旧巷老猫 提交于 2019-12-22 08:41:31
问题 I'm trying to create a custom UINavigationBar class and then use the Storyboard to set it as the class of my UINavigationController 's NavigationBar. Here's the code of my UINavigationBar class: class CustomNavBar: UINavigationBar { override func drawRect(rect: CGRect) { super.drawRect(rect) // Drawing code self.backgroundColor = UIColor.orangeColor() let myLabel = UILabel(frame: CGRect(x: 0, y: 4, width: 600, height: 36)) myLabel.backgroundColor = UIColor.purpleColor() myLabel.textColor =