• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[iPhone] UINavigationController and UINavigationBar
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iPhone] UINavigationController and UINavigationBar


  • Subject: [iPhone] UINavigationController and UINavigationBar
  • From: Duccio <email@hidden>
  • Date: Tue, 08 Dec 2009 18:46:18 +0100

Hi.

I created CustomNavBar subclassing UINavigationBar.

In Interface Builder I drag a Navigation Controller (UINavigationController) from the library to the document. Under this object in document window I can see a Navigation Bar (UINavigationBar). Clicking it and using the Identity Inspector I can change the class from standard UINavigationBar to my CustomNavBar.

How can I reproduce it programmatically?

	MyViewController *myViewController = [[MyViewController alloc] init];
	UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:myViewController];
	[myViewController release];

UINavigationController navigationBar property is read only so I can't do:

	CustomNavBar *customNavBar = [[CustomNavBar alloc] init];
	navController.navigationBar = customNavBar;
	[customNavBar release];

What should I do to customize the navigation bar programmatically? Is IB more "powerful" than "code"? I believed all that can be done in IB could be done also programmatically.

Duccio.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: [iPhone] UINavigationController and UINavigationBar
      • From: Luke the Hiesterman <email@hidden>
  • Prev by Date: Re: Localizing Xibs using bindings
  • Next by Date: CAShapeLayer and touches?
  • Previous by thread: Re: Customize the line's color that separates the window content from the title bar?
  • Next by thread: Re: [iPhone] UINavigationController and UINavigationBar
  • Index(es):
    • Date
    • Thread