Search Results

Search found 442 results on 18 pages for 'uinavigationcontroller'.

Page 1/18 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • UINavigationController inside UINavigationController view issue

    - by HurkNburkS
    I have two navigationcontrollers a main one and a sub one. The sub one is displaying inside the main one, which I am also hiding its navigationbar. as a result I am having some weird issues (things inside the view are being pushed down exactly the height of the navigationbar i am hiding) with the stuff I am displaying on the inside of the sub navigationcontroller. it looks like this. The left view is what I am doing in interface builder and the resulting view in the simulator. any help would be greatly appreciated. UPDATE: Here is the view with the subnav bar turned on so you can see the structure of my view. and here is the same view with the subnav turned off... can you see how the A is still sitting lower than it should be.. wel I think its because of the main navbar now as the whole subnavbar sits inside this view.. Last update that shows whats missing from the view

    Read the article

  • Presenting UINavigationController modally -- problem setting up tool and nav bar items in root view controller viewDidLoad

    - by Bogatyr
    In my iOS app I'm creating and presenting a UINavigationController modally like so: MyViewController *myvc = [[[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil] autorelease]; UINavigationController *navVC = [[[UINavigationController alloc] initWithRootViewController:myvc] autorelease]; [self presentModalViewController:navVC animated:YES]; In the MyViewController viewDidLoad I'm creating and setting toolbar items for the navigation controller's toolbar, like so: self.navigationController.toolbar.items = [NSArray arrayWithObjects:(items...), nil]; the problem I'm having is that the items don't show up. If instead I call a method from MyViewController's viewDidLoad method that adds the toolbar items via performSelector:withObject:afterDelay:0, then it works perfectly. So there's obviously some race condition going on here with the initial presentation of the UINavigationController, initialization of its toolbar/navbar, and the initialization of the nav bar's specified initial root view controller. I verified in the debugger that the root view controller's viewDidLoad is called after the UINavigationController's viewDidLoad method. In fact, the root view controller's viewDidLoad method is not called until presentModalViewController: is called, and the UINavigationController's viewDidLoad is called within initWithRootViewController, so doesn't that imply that the UINavigationController object should be "all ready to go", including its nav bar and toolbars? I thought at first that the navigation controller's toolbar object may not exist yet at MyViewController's viewDidLoad time, but it clearly does. At least, NSLog shows that it is not nil during MyViewController's viewDidLoad method. In fact, the UINavigationController's toolbar object is identical at both times: in the root view controller's viewDidLoad, and in the "setupToolbar" method that I called with performSelector:withObject:afterDelay, so it's not getting "re-initialized" somehow. So, what's going on here? Why aren't my toolbar modifications "sticking" in MyViewController's viewDidLoad, and why does performing them in the next iteration of the runloop (performSelector:withObject:afterDelay:0) make it work? What is the "right" way of setting up initial navbar / toolbar items in code from the rootViewController of the UINavigationController?

    Read the article

  • How to implement a UINavigationController to a standard UIView

    - by tarnfeld
    This is the structure of my application currently: UIWindow UIViewController (Root View Controller) UINavigationController UITableView UIViewController (PresentModalViewControllerAnimated:YES) UITableView This is how I want it to be: UIWindow UIViewController (Root View Controller) UINavigationController UITableView UIViewController (PresentModalViewControllerAnimated:YES) UINavigationController UITableView I have a view that slides up and I want that view to have its own UINavigationController. It's for the app settings so I want to have nested options. Any ideas how to do this? The application type was a Navigation app to start with which is where the Root View Controller's UINavigationController came from.

    Read the article

  • Adding a UINavigationController as a subview of UIView

    - by eagle
    I'm trying to display a UILabel on top of a UINavigationController. The problem is that when I add the UILabel as a subview of UIWindow it will not automatically rotate since it is not a subview of UIViewController (UIViewController automatically handles updating subviews during rotations). This is the hierarchy I was using: UIWindow UILabel UINavigationController So I was thinking I could use the following hierarchy: UIWindow UIViewController UIView UILabel UINavigationController This way the label could be displayed on top of the UINavigationController's bar while also automatically being rotated since it is a subview of UIViewController. The problem is that when I try adding a UINavigationController as a subview of a view: [myViewController.view addSubview:myNavigationController.view]; it will appear 20 pixels downwards. Which I'm guessing is because it thinks it needs to make room for the status bar. But, since the UINavigationController is being placed inside a UIView which does not overlay on top of the status bar, it is incorrectly adding an additional 20 pixels. In other words, the top of the UINavigationBar is at the screen's 40 pixel mark instead of at 20 pixels. Is there any easy way to just shift the UINavigationController and all of its elements (e.g. navigation bar, tool bar, root view controller) up 20 pixels? Or to let it know that it shouldn't compensate for a status bar? If not, I guess I would need to use my first hierarchy mentioned above and figure out how to rotate the label so it is consistent with the navigation bar's rotation. Where can I find more information on how to do this? Note: by "displaying a label on top of the navigation bar", I mean it should overlay on top of the navigation bar... it can't simply be wrapped in a bar button item and placed as one of the items of the navigation bar.

    Read the article

  • UINavigationController inside tabbar loading a child root view

    - by Doug
    Hi guys, Firstly i'll preface by saying that i am a complete Cocoa touch/objective c noob (.Net dev having a dabble) I have searched on Google as well as here but cannot seem to find an easy solution. I have a UItabbarcontroller view with a UINavigationController inside its first tab I have the root view for this UINavigationController stored in a seperate class and NIB as i am trying to seperate the data viewing from the data loading (i'm going to reuse the table list in multiple places in my database) and simply pass the root view its data using a loading method and have it take it from there. What i want to happen: App loads and loads the first view of the tab bar (A UINavigationController) The UINavigationController inside the first view loads a root view (a UIViewController with a table view) and sets its title The UINavigationController loads the data from a web service and parses it The UINavigationController sends the data to a loading method inside the UIViewController Am i thinking about this completely wrongly? What currently happens: the first tab bar loads with an empty uinavigationcontroller (no table view) the data methods fire and get the webservice data this child view gets sent its data using the loading method the tableview delegate events fail to fire inside the child view telling it to load the data into the table I just can't seem how to load my second view inside the root view of the navigation controller and then send it my data?

    Read the article

  • UITabBarController With UINavigationController "more" Tab Issue

    - by Medlay
    UITabBarController with UINavigationController "more" tab issue There is a problem with using UINavigationController in UITabBarController. I have a TabBar  with 6 items. Of course, a standart item "more" appears, and there are two UINavigationControllers that didn't fit in a TabBar. The core of the problem is: when I'm working with visible items (a first four), UIViewController can be pushed  in an UINavigationController: [self.navigationController pushViewController:userDataViewController animated:YES]; If you call on in "more" and rearrange items in such way, that a visible UINavigationController gets into "more", when calling on it userDataViewController appears.  This  userDataViewController is the last, which has got in a stack and a Back button leads back to "more", but not to the controllers, that were before a userDataViewController appeared. I understand that in fact a selector pushViewController is called from "more", and it pushes my UINavigationController in a stack, and it's not good. Maybe, someone has faced such problem and could help me to solve it? Thank you forward.

    Read the article

  • UINavigationController placement problem

    - by Chonch
    Hey, I'm having this problem and I can't seem to figure out why! I want to use a UINavigationController, but I don't want to use it through out the entire application. So, in the UIViewController I was to add it to, I define: UINavigationController *navigationController; and the @property, @synthesize and dealloc. In the viewDidLoad method, I add: navigationController = [[UINavigationController alloc] init]; navigationController.navigationBar.barStyle = UIBarStyleBlack; and when the relevant UIViewController is loaded, I add: [navigationController pushViewController:viewController animated:NO]; and make the old view disappear and the UINavigationController's view to appear. Everything works fine except that the navigation bar appears about 20pixels too low (dragging the entire view down and out of the screen). If I set the UINavigationController's view frame parameter manually to start at 0,0, it jumps there, but only after about a second, so that you can see the navigation bar starting at a certain location and only then jumping to another (and it is ugly!). I have done the exact same thing in the past and had no problem with it. Does anyone know what may cause this? Thanks,

    Read the article

  • Adding a UINavigationController to a UITabBarController

    - by Andy Jacobs
    I have a set of 10 navigationViewControllers i want to the UITabBarController this all just works fine except the fact when i want to see a UINavigationController that is in the "more" tab it doesn't switch to it. it does nothing. if i change that to a UIViewController it just works fine .. ok in the more tab you automatically have a UINavigationController to you disposal but if the user switches the tab's order and its not anymore in the "more" tab you don't have a UINavigationController .. any tips ?

    Read the article

  • UINavigationController + shouldAutoRotate + no subclassing

    - by ACBurk
    I have a navigation driven app. I need that app to rotate. The UINavigationController is the root controller/view in the window. I know (and have experienced why) it is a no-no to subclass UINavigationController. I know all i have to do is insert: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } into the UINavigationController and it will rotate fine. So my question is: how do I enable rotation on the root view controller (UINavigationController) WITHOUT subclassing it?

    Read the article

  • UINavigationController as child view of UIViewController

    - by Gregg
    I have an application that isn't nav based. So there is no UINavigationController in the App Delegate. However, I need to switch to a UINavigationController for a piece of the application. Steps I currently took... Create a new Class that extends UIViewController Added a UINavigationController via IB Told IB that the new UIViewController's view is the view for the UINavigationController The problem now is that the File's Owner needs it's view set. But via IB there is no way to specify this. So obviously, I'm not going about this the right way. Any tips in the right direction are much appreciated.

    Read the article

  • Two UIViews, one UIViewController (in one UINavigationController)

    - by jdandrea
    Given an iPhone app with a UITableViewController pushed onto a UINavigationController, I would like to add a right bar button item to toggle between the table view and an "alternate" view of the same data. Let's also say that this other view uses the same data but is not a UITableView. Now, I know variations on this question already exist on Stack Overflow. However, in this case, that alternate view would not be pushed onto the UINavigationController. It would be visually akin to flipping the current UIViewController's table view over and revealing the other view, then being able to flip back. In other words, it's intended to take up a single spot in the UINavigationController hierarchy. Moreover, whatever selection you ultimately make from within either view will push a common UIViewController onto the UINavigationController stack. Still more info: We don't want to use a separate UINavigationController just to handle this pair of views, and we don't want to split these apart via a UITabBarController either. Visually and contextually, the UX is meant to show two sides of the same coin. It's just that those two sides happen to involve their own View Controllers in normal practice. Now … it turns out I have already gone and quickly set this up to see how it might work! However, upon stepping back to examine it, I get the distinct impression that I went about it in a rather non-MVC way, which of course concerns me a bit. Here's what I did at a high level. Right now, I have a UIViewController (not a UITableViewController) that handles all commonalities between the two views, such as fetching the raw data. I also have two NIBs, one for each view, and two UIView objects to go along with them. (One of them is a UITableView, which is a kind of UIView.) I switch between the views using animation (easy enough). Also, in an effort to keep things encapsulated, the now-split-apart UITableView (not the UIViewController!) acts as its own delegate and data source, fetching data from the VC. The VC is set up as a weak, non-retained object in the table view. In parallel, the alternate view gets at the raw data from the VC in the exact same way. So, there are a few things that smell funny here. The weak linking from child to parent, while polite, seems like it might be wrong. Making a UITableView the table's data source and delegate also seems odd to me, thinking that a view controller is where you want to put that per Apple's MVC diagrams. As it stands now, it would appear as if the view knows about the model, which isn't good. Loading up both views in advance also seems odd, because lazy loading is no longer in effect. Losing the benefits of a UITableViewController (like auto-scrolling to cells with text fields) is also a bit frustrating, and I'd rather not reinvent the wheel to work around that as well. Given all of the above, and given we want that "flip effect" in the context of a single spot on a single UINavigationController, and given that both views are two sides of the same coin, is there a better, more obvious way to design this that I'm just happening to miss completely? Clues appreciated!

    Read the article

  • Autorotate UINavigationController based Application in IPhoneOS 3.0

    - by Shoaibi
    I have an application which have code like: window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // UIWindow *window; viewController = [TopicsViewController new]; //TopicsViewController *viewController; //This is a UITableViewController navigationController = [UINavigationController new]; // UINavigationController *navigationController; UIImageView *background = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"background.png"]]; [self.navigationController.view addSubview:background]; [self.navigationController.view sendSubviewToBack:background]; [navigationController pushViewController:viewController animated:YES]; [window addSubview:[navigationController view]]; [window makeKeyAndVisible]; Basically i am using UINavigationController and then push UITableViewController or sometime a UIViewController. UIViewController contain elements such as UITextView, UIImage, UIScrollView. Problem is i have been trying to make this application respond to iphone rotation e.g. when held in landscape, application should switch to landscape and vice versa, but nothing works so far.

    Read the article

  • UITabBarController's 'More' navigation controller disappears under UINavigationController

    - by lennox_19
    I am using a UITabBarController as well as a UINavigationController on my app. In my UITabBarController I am using more than 5 items so I automatically get the 'More' item. I've managed to add a saving procedure so the order of those items will be kept in case somebody changes the order etc. With 'More' active I get the More navigation controller with the 'Edit' item positioned under my UINavigationController. Both navigation controller are visible. When I click on 'Edit though the More navigation controller disappears and seem to be hiding under my UINavigationController and therefore I can't see/use the 'Done' function to save my new order What did I miss? Cheers

    Read the article

  • UINavigationController Right button

    I am unable to set any property of parentController (which is always a UINavigationController in my case) from child views. e.g. I want to add a button on the navigation bar using following code: UINavigationController* parentController = (UINavigationController)self.parentViewController; UIBarButtonItem *addButton = [[[UIBarButtonItem alloc] initWithTitle:@"Something" style:UIBarButtonItemStyleBordered target:self action:@selector(doSomething)] autorelease]; [_parentController.navigationItem setRightBarButtonItem:addButton animated:YES]; This code runs perfectly without errors but I can't see any button added to the navigation bar. Thanks in advance.

    Read the article

  • saving iPhone program state with a deep UINavigationController

    - by jr
    Can someone a good way to save the program state (UINavigationController stack, etc) of an iPhone application. My application obtains a bunch of information from the network and I want to return the person back to the last screen they were on, even if it was 3 or 4 screens deep. I assume that I will need to reload the data from the network along the way as I recreate the UINavigation controllers. I don't necessarily have a problem with this. I'm thinking about maybe having my UINavigationController objects implement some type of protocol which allow me to save/set their state? I'm looking to hear from others who may have needed to implement a similar scenario and how they accomplished it. My application has a UITabbarController at the root and UINavigationController items for each tab bar item. thanks!

    Read the article

  • How to add Button in UINavigationController

    - by Ali
    Hi all , navigator=[[UINavigationController alloc]initWithRootViewController:contacts]; UIBarButtonItem *nextButton = [[UIBarButtonItem alloc] initWithTitle:@"Delete" style:UIBarButtonItemStyleBordered target:self action:@selector(makeCall)]; //[[self.navigator navigationItem] setLeftBarButtonItem:nextButton]; self.navigator.navigationBar.items=[NSArray arrayWithObject:nextButton]; I am adding a button to UINavigationController and got following exception please help me 2011-01-03 11:46:26.626 Appointment[2243:207] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cannot call setItems:animated: directly on a UINavigationBar managed by a controller.' 2011-01-03 11:46:26.634 Appointment[2243:207] Stack: ( 3040

    Read the article

  • UINavigationController crash because of pushing and poping UIViewControllers

    - by Wayne Lo
    My question is related to my discovery of a reason for UINavigationController to crash. So I will tell you about the discovery first. Please bare with me. The issue: I have a UINavigationController as as subview of UIWindow, a rootViewController class and a custom MyViewController class. The following steps will get a Exc_Bad_Access, 100% reproducible.: [myNaviationController pushViewController:myViewController_1stInstance animated:YES]; [myNaviationController pushViewController:myViewController_2ndInstance animated:YES]; Hit the left back tapBarItem twice (pop out two of the myViewController instances) to show the rootViewController. After a painful 1/2 day of try and error, I finally figure out the answer but also raise a question. The Solutio: I declared many objects in the .m file as a lazy way of declaring private variables to avoid cluttering the .h file. For instance, #impoart "MyViewController.h" NSMutableString*variable1; @implement ... -(id)init { ... varialbe1=[[NSMutableString alloc] init]; ... } -(void)dealloc { [variable1 release]; } For some reasons, the iphone OS may loose track of these "lazy private" variables memory allocation when myViewController_1stInstance's view is unloaded (but still in the navigation controller's stacks) after loading the view of myViewController_2ndInstance. The first time to tap the back tapBarItem is ok since myViewController_2ndInstance'view is still loaded. But the 2nd tap on the back tapBarItem gave me hell because it tried to dealloc the 2nd instance. Executing [variable release] resulted in Exc_Bad_Access because it pointed randomly (loose pointer). To fix this problem is simple, declare variable1 as a @private in the .h file. Here is my Question: I have been using the "lazy private" variables for quite some time without any issues until they are involved in UINavigationController. Is this a bug in iPhone OS? Or there is a fundamental misunderstanding on my part about Objective C? Please help.

    Read the article

  • UINavigationController navigation stack problems in Landscape Mode

    - by David F
    I have a iPhone application that I am currently converting to a Universal Binary to work with the iPad. I have successfully implemented everything I need in terms of layout so that full landscape functionality is now supported in my app (previously I primarily used portrait mode to display content). But, I have one strange problem, and it ONLY occurs in landscape mode: when I push a view controller onto the stack, it takes two taps on the back button to return to the previous view controller!!! The first tap shows a blank view, but with the same name on the left-side back navigation button, the second tap takes the controller back to previous view like it should. I don't have an iPad to test, so I am relying on the simulator. The problem does not show up on the iPhone and doesn't show up if you rotate back to portrait mode. My app consists of a tabbarcontroller with navigation controllers loaded for its vc's: //application delegate - (void)applicationDidFinishLaunching:(UIApplication *)application //.... WebHelpViewController *vc8 = [[WebHelpViewController alloc] init]; UINavigationController *nv8 = [[UINavigationController alloc] initWithRootViewController:vc8]; [self.tabBarController setViewControllers:[NSArray arrayWithObjects:nv1,nv2,nv3,nv4,nv5,nv6,nv7,nv8,nil]]; To implement landscape capability, the UITabBarController is overridden to autorotate when required: //CustomTabBarController.m - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return [[(UINavigationController *)self.selectedViewController topViewController] shouldAutorotateToInterfaceOrientation:interfaceOrientation]; } ... works fine. I navigate into new views using this method SomeViewController *vc = [[SomeViewController alloc] init]; [self.navigationController pushViewController:vc animated:YES]; [vc release]; Has anyone encountered this problem, and do they know if it's only a simulation error?

    Read the article

  • Steps in subclassing UINavigationController

    - by RickiG
    Hello I would like to subclass the UINavigationController to get some more freedom in regards to the appearance of the controller. I have some graphics for the different parts, bars, buttons, text etc. Looking at the UINavigationController header file I get little help, I don't know where to start out. I have never subclassed/overridden a UIKit component before, it seems it is a bit like playing Sherlock Holmes. What is the approach? How do I know what to override to get a a specific piece of graphics "injected" the correct place? Do I need to subclass UINavigationBar, UIBarButtonItem etc. etc to get the complete customized look? How do I know if something is off limits in regards to being approved by Apple? Hope someone can point me in the right direction, I have only been able to find examples of changing small parts of the controller, not a full customization by subclassing. Am I going about this the wrong way? Thanks:)

    Read the article

  • UINavigationController flashes white when I add it to a superview

    - by Chris Stamper
    Hey guys, I'm adding a NavigationController as a subview of my main view, with the flip animation (like a utility app/flipview thing). Here's how I'm doing it: [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:.7]; [UIView setAnimationTransition:([self.tableController.view superview] ? UIViewAnimationTransitionFlipFromLeft : UIViewAnimationTransitionFlipFromRight) forView:self.tableHostView cache:YES]; [self.tableController.view removeFromSuperview]; settingsView* backView1 = [[settingsView alloc] initWithNibName:@"settingsView" bundle:nil]; backView1.delegate = self; UINavigationController* settingsNavStack = [[UINavigationController alloc]initWithRootViewController:backView1]; [backView1 release]; settingsNavStack.view.frame = CGRectMake(0, 0, 320, 460); settingsNavStack.navigationItem.title = @"Settings"; [self setBackView:settingsNavStack]; [settingsNavStack release]; [self.tableHostView addSubview:self.backView.view]; [[self backView]setDelegate: self]; When it loads, the view comes in very nicely. However, the navigation bar stays white until like .2 secs after the animation finishes. Anyone know why the navigation bar wouldn't display right away?

    Read the article

  • UINavigationController not working under ARC in iPhone

    - by user1811427
    I have creared a new project "Empty Application" template in Xcode 4.3, it is having only two classes AppDelegate.h & .m I cheaked with ARC to use automatic reference count while creating the app. I added two new files "RootViewController" & "NewProjectViewControllers". I implemented code to set navigation controller as follows in AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. rootViewController = [[MainViewController alloc] init]; UINavigationController *navigation = [[UINavigationController alloc] initWithRootViewController:rootViewController]; [self.window addSubview:navigation.view]; self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; return YES; } and in hte home view (Root view controller) implemented as follows - (void)viewDidLoad { [super viewDidLoad]; self.title = @"Projects"; UINavigationBar *navigationBar = [self.navigationController navigationBar]; [navigationBar setTintColor: [UIColor colorWithRed:10/255.0f green:21/255.0f blue:51/255.0f alpha:1.0f]]; //To set the customised bar item UIButton *rightBarBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [rightBarBtn setBackgroundImage:[UIImage imageNamed:@"plus_new.png"] forState:UIControlStateNormal]; rightBarBtn.frame=CGRectMake(0.0, 100.0, 30.0, 30.0); [rightBarBtn addTarget:self action:@selector(addProject) forControlEvents:UIControlEventTouchUpInside]; UIBarButtonItem* rightBarItem = [[UIBarButtonItem alloc] initWithCustomView:rightBarBtn]; self.navigationItem.rightBarButtonItem = rightBarItem; // Do any additional setup after loading the view from its nib. } - (void) addProject { NewProjViewController *editProject = [[NewProjViewController alloc] init]; [self.navigationController pushViewController:editProject animated:YES]; NSLog(@"xxxxxxxxxxxxxxx"); } But since i used ARC the navigation may dealoc immediately and it doesn't work, All the actions in method works except push to the next view if i do same thing with out ARC it works fine How to resolve this issue..? Thanks in advance

    Read the article

  • View outlet not set with UINavigationController

    - by Sheehan Alam
    I have a NIB that contains a UINavigationController which has a UIViewController. The UIViewController is being loaded externally from another nib. I am unable to set the view property thus I get the error: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "LBRootViewController" nib but the view outlet was not set.' How can I set my view property correctly?

    Read the article

  • Best way to set default tint for UINavigationController

    - by Brian
    I use a lot of UINavigationControllers in my app. I am using a UIColor to set the tintcolor of the navigationBar. This works as expected, but I am trying to find an easy way to set a default tintcolor for all UINavigationControllers. What is the best way to do this? Is it subclassing the UINavigationController, or is there something better? Thanks for the help.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >