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 9018483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:32:17+00:00 2026-06-16T04:32:17+00:00

I am just about to start a new project where I have a custom

  • 0

I am just about to start a new project where I have a custom menu that I need to display on everyview that I have. I dont want to use tab bars as this menu is custom designed and may have some animation added to it at some point.

Is there a simple way of creating this menu in one place so that I dont have to build it into every xib file??

Thanks

  • 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-16T04:32:19+00:00Added an answer on June 16, 2026 at 4:32 am

    The tab bar controller is a system provided container controller. If you’re using iOS 5 and later, you can make your own custom container view controller:

    • See Custom Container View Controllers discussion in the View Controller Programming Guide.

    • The key methods you need are enumerated in the UIViewController Class Reference, too.

    • I’d also suggest checking out WWDC 2011 #102 – Implementing UIViewController Containment.


    Update:

    If you want to write your own custom menu, you could do something like the following. I’m not doing anything fancy, but I’m just adding three colored subviews that might correspond to your custom buttons. And I have a tap gesture recognizer on each, which you can obviously handle as you see fit:

    NSInteger const kHeight = 50;
    NSInteger const kCount = 3;
    
    @interface CustomMenu ()
    @property (nonatomic, strong) NSMutableArray *menuViews;
    @end
    
    @implementation CustomMenu
    
    
    - (id)init
    {
        self = [super init];
        if (self)
        {
            _menuViews = [[NSMutableArray alloc] init];
            for (NSInteger i = 0; i < kCount; i++)
            {
                UIView *subview = [[UIView alloc] init];
                subview.tag = i;
                [self addSubview:subview];
                [_menuViews addObject:subview];
                UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
                [subview addGestureRecognizer:recognizer];
            }
    
            [_menuViews[0] setBackgroundColor:[UIColor blueColor]];
            [_menuViews[1] setBackgroundColor:[UIColor redColor]];
            [_menuViews[2] setBackgroundColor:[UIColor greenColor]];
        }
        return self;
    }
    
    - (void)layoutSubviews
    {
        CGFloat width = self.superview.bounds.size.width;
        CGFloat height = self.superview.bounds.size.height;
    
        CGFloat menuChoiceWidth = width / kCount;
    
        self.frame = CGRectMake(0, height - kHeight, width, kHeight);
    
        NSInteger subviewIndex = 0;
    
        for (UIView *subview in self.menuViews)
        {
            subview.frame = CGRectMake(subviewIndex * menuChoiceWidth, 0,
                                       menuChoiceWidth, kHeight);
            subviewIndex++;
        }
    
    }
    - (void)handleTap:(UITapGestureRecognizer *)recognizer
    {
        NSLog(@"%s tapped on %d", __FUNCTION__, recognizer.view.tag);
    }
    
    @end
    

    Then, you various view controllers just need to make sure to add the CustomMenu to the view:

    @interface ViewController ()
    @property (nonatomic, strong) CustomMenu *menu;
    @end
    
    @implementation ViewController
    
    - (void)viewDidLoad
    {
        [super viewDidLoad];
    
        self.menu = [[CustomMenu alloc] init];
        [self.view addSubview:self.menu];
    }
    
    - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
    {
        [self.menu layoutSubviews];
    }
    
    @end
    

    I confess that I’ve given up on iOS 4.3 support (it just isn’t worth the heartache and the size of the 4.3 audience is pretty small nowadays), so I don’t deal with this silliness any more, but hopefully this gives you a sense of what one possible solution might look like.

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

Sidebar

Related Questions

I'm new to Django... I need to start a project that will have subdomains,
I'm just about to start a new project on ASP.NET MVC using LINQ to
I have just installed Xcode 4.2, and I was about to start a new
I'm about to start building a new asp.net project, and I'm just starting out
I have to start a new Spring MVC project and I've been reading about
I'm just about to start a new project of mine and am currently evaluating
I'm about to start a new project which would allow users to navigate through
We are about to start a new project. It will be a group of
I'm about to start a new project. It's about selling one completely customizable product.
We have just started our new assignment - web-based project. Before I get directly

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.