uinavigationcontroller

How to show a UISearchBar from top of screen for table view controller

亡梦爱人 提交于 2019-12-21 02:31:23
问题 I'm looking to duplicate how the Facebook Messenger app shows the UISearchBar. When you tap the leftBarButtonItem in the navigationBar, the UISearchBar appears/animates from the top of the screen down, and when you cancel, it simply disappears upwards where it originated from. I used to have my UISearchBar as the default setup in my table view's header (in storyboard), but now I'm wanting to do what I stated above but I am not sure where to begin. My search displayer controller is still in my

Local Declaration “x” hides instance variable xcode warning

冷暖自知 提交于 2019-12-20 16:34:47
问题 I've been have trouble understand this problem. If I change the variable name fifthViewController the error goes away but the view controller doesn't load. Lost. Once again it's probably something simple. Thanks in advance. Here is the code: { FifthViewController *fifthViewController = [[FifthViewController alloc] initWithNibName:@"FifthView" bundle:nil]; fifthViewController.transactionID = transactionID; [self.navigationController pushViewController:fifthViewController animated:NO];

How to add UIBarButtonItem to NavigationBar while using UIPageViewController

北慕城南 提交于 2019-12-20 14:08:13
问题 Please forgive me, there are already a ton of questions on how to add a UIBarButtonItem to a NavigationBar programmatically but I just can't seem to get any of the solutions to work in my situation. Here is the layout of a simple test app I have been working with to learn the UIPageViewController. I have the page view controller working nicely with three unique viewControllers. I would now like to set unique rightBarButtonItems for each of the view controllers. I can easily set a common

How to add UIBarButtonItem to NavigationBar while using UIPageViewController

淺唱寂寞╮ 提交于 2019-12-20 14:07:22
问题 Please forgive me, there are already a ton of questions on how to add a UIBarButtonItem to a NavigationBar programmatically but I just can't seem to get any of the solutions to work in my situation. Here is the layout of a simple test app I have been working with to learn the UIPageViewController. I have the page view controller working nicely with three unique viewControllers. I would now like to set unique rightBarButtonItems for each of the view controllers. I can easily set a common

Subclassing UINavigationBar … how do I use it in UINavigationController?

两盒软妹~` 提交于 2019-12-20 12:48:10
问题 I wanted to subclass UINavigationBar (to set a custom background image & text color) and use that for all the navigation bars in my app. Looking at the API docs for UINavigationController, it looks like navigationBar is read-only: @property(nonatomic, readonly) UINavigationBar *navigationBar Is there a way to actually use a custom UINavigationBar in my UIViewControllers? I know that other apps have done custom navigation bars, like flickr: http://img.skitch.com/20100520

iOS 8: Presenting a modal view controller in portrait causes resize of the navigation bar of the underlying landscape navigation controller

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-20 12:43:24
问题 On iOS 8 I have a strange behavior regarding the navigation bar and orientation changes. I have a navigation controller which reports a supported interface orientation UIInterfaceOrientationMaskLandscapeRight . The navigation bar has the expected height for landscape orientation (sadly I am not entitled to post screenshots). Then I initiate a modal presentation of a view controller that only supports UIInterfaceOrientationMaskPortrait . When the presentation animation starts, it seems that

How do I pop the view controller underneath a pushed view controller?

岁酱吖の 提交于 2019-12-20 12:34:12
问题 I want to push a view controller onto the stack, then pop the first one that pushed the new one. -(void) someMethod { MegaSuperAwesomeViewController *tempVC = [[MegaSuperAwesomeViewController alloc] init]; [self.navigationController pushViewController:tempVC animated:YES]; [tempVC release]; // pop this VC, how? } EDIT: turns out I can pop back 2 view controllers instead once finished with the new VC. Still not what I wanted exactly, but it works. The downside is I need to set a flag to

How to add a navigation controller to a view-based application?

痞子三分冷 提交于 2019-12-20 10:58:22
问题 Is it possible to add a UINavigationController to a view application that inherits from UIViewController and not UITableViewController ? How is it done? 回答1: Yes, you can have Navigation controllers in any view based application, whether at the Root level (like when you create the Navigation-based template in Xcode) or with a TabBar root, or with any Root. One example, presenting a modal view including navigation (used in my app to display a series of forms): UIViewController *control = [

Adding a title to the left side of the navigation bar

旧街凉风 提交于 2019-12-20 10:36:13
问题 Is it possible to add a title to the left side of the navigation bar? I know how I can add a title in the center but when I try to add one to the left side I see nothing. This is the code I have: self.navigationItem.leftBarButtonItem?.title = "Elapsed Time: 0:00" Thank you for the help. 回答1: Try this code: let leftItem = UIBarButtonItem(title: "Title", style: UIBarButtonItemStyle.plain, target: nil, action: nil) leftItem.isEnabled = false self.navigationItem.leftBarButtonItem = leftItem More

Accessing a Top Navigation Controller from a Subview Navigation Controller

丶灬走出姿态 提交于 2019-12-20 10:33:15
问题 I have a my views and controllers set up like so. A Tab/Bar controller Within 1. is a root view controller within 2. is a programmatically created navigation controller, that is displayed as a subview in the root view controller. What I am trying to do is access the top tab bar/navigation controller so that i can push a view onto it. I tried parentViewController but all it did was push the view onto the programmed nav controller. any suggestions? This is how i set up my root view controller: