objective c - iOS5: How to style NavigationBar and NavigationToolBar? (background and size) -


I think that I want to do something that would be easy to leave, but it has become very difficult! I want to style Toolbar's navigation bar and my navigation controller I want to do both:

  1. A custom background image, I know that I can use the presence proxy, but this The following points will not meet the requirements.
  2. The navigation bar and toolbar should be of the same height of the background images that I set for them. I tried to set the height of the frame but it does not work.
  3. In the end, I want to add some buttons (with specific height and width, not a fixed / standard) in the navigation bar and toolbar, but I hope Toolbar / Navigation will behave just like a UIView .

    How do I get these three points? Thanks!

    What I did for this was to create images that look like pictures created in the navigation bar Built a back button that was very close to the default. You can of course do whatever you want it took a lot of time but once you have done so, you can load them in your app as UIImageView and UIButton. Very easy. And fully customizable

      - (zero) viewDidoad {UIView * navBarView = [[UIView alloc] initWithFrame: CGRectMake (0,0,320,44)]; UIImageView * navBarImg = [[UIImageView alloc] initWithFrame: CGRectMake (0,0,320,44)]; [NavBarImg setImage: [UIImage imageNamed: @ "Navigation BarImage"]]; // The name of the .png file you created [navBarView addSubview: navBarImg]; UIButton * Backbutton = [UIButtonTypeCustom] with UIButton Button; [BackButton setBackgroundImage: [UIImage imageNamed: @ "backButtonNormal"] forState: UIControlStateNormal]; [BackButton setBackgroundImage: [UIImage imageNamed: @ "backButtonHighlighted"] forState: UIControlStateHighlighted]; [Backbutton Setframe: CGRKamac (5,5,40,35)]; // Depending on how you do your button [Back button button: Self-action: @Selector (back button button) Control Event: UI Control Event Touchup Inside]; [NavBarView addSubview: backbutt]; // Repeat for whatever you want to add. [Self.view addSubview: navBarView]; } - (IBAction) Back Baton Button: (ID) Sender {[Self. Navigation Controller PopWebControllerUnited: Yes]; } // VC's Pushing // I usually make a declared property for the Vice Chancellor and then: - (IABT) VisibilityPCCC {Agrexqux * _nextVC = [[Next VC Alok] initWithNibName: @ "NextVC" bundle: zero]; [Self-Setdactavesi: _nextVC]; [Self. Navigation controller Push ViewController: animated nextVC: Yes]; }    

Comments