Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7963147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:32:42+00:00 2026-06-04T05:32:42+00:00

I need UIToolbar when my application launches. It will be on every screen through

  • 0

I need UIToolbar when my application launches. It will be on every screen through out the application. So for that i have add it in RootViewController.

#import "AppDelegate.h"
#import "MainViewController.h"

@implementation AppDelegate

@synthesize window = _window;
@synthesize mainViewController = _mainViewController;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]autorelease];
// Override point for customization after application launch.
self.mainViewController = [[[MainViewController alloc]init]autorelease];
self.window.rootViewController = self.mainViewController;
[self.window makeKeyAndVisible];
return YES;
}

Currently i have UIToolbar in MainViewController

 // create the UIToolbar at the bottom of the MainViewController
toolbar = [UIToolbar new];
toolbar.barStyle = UIBarStyleBlackOpaque;
// size up the toolbar and set its frame
toolbar.frame = CGRectMake(0, 425, 320, 40);
[self.view addSubview:toolbar];

In all my other UIViewControllers i m adding it like this

[self.view addSubview:toolbar]; 

which i don’t want. I want UIToolbar to show automatically in all my other UIViewControllers after attaching it to rootviewcontroller. so that when i flip UIViewController to change to another UIViewController. Only UIViewController should flip not UIToolbar.Right now UIToolbar is also flipping with UIViewController. So that is the reason i want to attach it to the rootviewcontroller.

So how can i add UIToolbar in APPDelegate file and attach it to rootviewcontroller.

Thanks for help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:32:43+00:00Added an answer on June 4, 2026 at 5:32 am

    Everything looks okay in your code except when you create the UIToolbar, for some reason at that point you make your own syntax. This is how you create a UIToolBar

    Example:

    UIToolbar *toolBar = [UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 44);
    

    Seriously, your code would not compile, and you would know at exactly what line. Connect the dots and Google how to create a UIToolbar.

    Edit:

    For the Toolbar being display in every view you have a few options:

    (1) Are you sure you don’t want a UINavigationController & UINavigationBar?

    (2) Attach it at the UIWindow (i.e. add two subviews to the window). This has to be created with code, I do not believe interface builder is going to work.

    (3) Just create it when each view loads in either (init or viewDidLoad methods)

    Okay, so you would have to add the Toolbar to each view controller (i.e. addSubView). The only other way is to add two subViews to the AppDelegate.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have UITableView being pushed to UINavigationController. I need to add a UIToolBar to
need a little help with this one. I have a form that I am
I need to create a UIToolbar that has two UIBarButtonItems. The 1st button must
I have a view that has a UISegmentedControl in its bottom UIToolBar with 2
I have opted to use a UITableViewController without a nib. I need a UIToolbar
I have an button on UIToolbar. i need to display another toolbar on clicking
I have added the toolbar using Interface Builder, but I need to add the
need to add a 2nd css stylesheet to a page. do i add a
Need some help, please. I have a line of horizontal thumbnails loaded as ONE
Need to use own imaged markers instead built-in pins. I have several questions. 1.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.