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

  • SEARCH
  • Home
  • 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 7922151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:51:14+00:00 2026-06-03T16:51:14+00:00

How can I develop a toolbar like this one, with a button that when

  • 0

How can I develop a toolbar like this one, with a button that when it’s pressed reveals another toolbar (sliding on top of the current one)? This is a screenshot from the iPhoto application from Apple.

https://i.stack.imgur.com/dKYZq.png

  • 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-03T16:51:16+00:00Added an answer on June 3, 2026 at 4:51 pm

    I got this to work using the following (Disclaimer: THIS MAY VIOLATE THE HIG!):

    1. I added a new, basic UIViewController.
    2. I added a UIToolbar to the view of the UIViewController. I connected this UIToolbar to a property in my UIViewController named “BaseToolbar”.
    3. To “BaseToolbar”, I added a button. I connected this button to an IBAction called “AddPressed:” in my UIViewController.
    4. I added a UIToolbar to the UIViewController’s xib, BUT NOT ON THE UIViewController’s view. I just added it onto the design surface. I connected this UIToolbar to a property in my UIViewController named “SecondToolbar”.
    5. To “SecondToolbar”, I added a button. I connected this button to an IBAction called “TrashPressed:” in my UIViewController.

    I used the following code:

    - (IBAction)AddPressed:(id)sender {
        CGRect secondCurrRect = [[self SecondToolbar] frame];
        [[self SecondToolbar] setFrame:CGRectMake(0, -1 * secondCurrRect.size.height, secondCurrRect.size.width, secondCurrRect.size.height)];
        [[self view] addSubview:[self SecondToolbar]];
        [[self view] bringSubviewToFront:[self SecondToolbar]];
        [UIView animateWithDuration:1.0
                         animations:^(void){
                             [[self SecondToolbar] setFrame:CGRectMake(0, 0, secondCurrRect.size.width, secondCurrRect.size.height)];
                         }];
    }
    - (IBAction)TrashPressed:(id)sender {
        CGRect secondCurrRect = [[self SecondToolbar] frame];
        [UIView animateWithDuration:1.0
                         animations:^(void){
                             [[self SecondToolbar] setFrame:CGRectMake(0, -1 * secondCurrRect.size.height, secondCurrRect.size.width, secondCurrRect.size.height)];
                         }
                         completion:^(BOOL finished) {
                             [[self SecondToolbar] removeFromSuperview];
                         }];
    }
    

    Using that code, the new UIToolbar slides on/off ON TOP OF the “base” UIToolbar.


    Edit/Update

    Let’s try a different tactic.
    (This assumes you’re adding the UIToolbar objects to your xib at design time)

    1. Add Toolbar #1 (the one that is always on-screen) to the top of the view and position it like you want.
    2. Add Toolbar #2 (the one that slides on/of) underneath Toolbar #1 and build it out with the buttons you want.
    3. Put the following line of code into your -(void)viewDidLoad method (this will move the second toolbar off-screen):

    [[self Toolbar2] setFrame:
        CGRectMake(0,                                    // origin.x
                   -[[self Toolbar2] frame].size.height, // origin.y
                   [[self Toolbar2] frame].size.width,   // size.width (remains the same)
                   [[self Toolbar2] frame].size.height)  // size.height (remains the same)
    ];
    

    Then, use the code from above, but skip the calls to addSubview: and removeFromSuperview.

    Does that make sense now?

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

Sidebar

Related Questions

I'm hearing this alot, that you can develop an app in WPF and run
Hi I want to develop Facebook like toolbar in my asp.net site. How can
How i can install the CDT plug-in (that you can develop in C++ under
i would like to know if i can develop a OpenSocial based application for
I want to learn C++ so that i can develop C++ Python modules for
Friends, I like to know using which version of Android SDK we can develop
Is there a way you can develop on a device that has your application
I was wondering that can I develop applications on any android-based smartphone that is
I understand that you can't develop in Visual Studio 2010 for a remote Sharepoint
Is there a framework or something out there so that I can develop webpages

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.