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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:03:24+00:00 2026-05-21T09:03:24+00:00

I have set a custom gradient color background for my nav bar. I want

  • 0

I have set a custom gradient color background for my nav bar. I want to set the same, matching color to some blank space I have at the bottom of my viewcontroller behind my UIButton.

This is the code I used for the navbar. How can I use the exact same color and set it just for that small square section?

self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:35/255.0 green:161.0/255.0 blue:202.0/255.0 alpha:1.0];
  • 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-05-21T09:03:24+00:00Added an answer on May 21, 2026 at 9:03 am

    Though your question is not too clear, what I can gather from it is that you want a matching toolbar, similar to the navigationbar, behind a button at the bottom of a view.

    You can use the UIToolbar object: UIToolbar Documentation

    Treat it like you would treat any other view.

    To add it to your view controller use the following code:

    CGFloat toolbarheight = 44.0f;
    
    UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height - toolbarheight, self.view.frame.size.width, toolbarheight)];
    toolbar.tintColor = [UIColor colorWithRed:35/255.0 green:161.0/255.0 blue:202.0/255.0 alpha:1.0];
    
    [self.view addSubview:toolbar];
    [toolbar release];
    

    This should be done before you add your button as a subview.

    You did mention that you wanted to use that color for a square section for which you would modify the frame of the toolbar on the init.

    After this, it would be good practice to add the button as a subview of the toolbar so if you want to move the button and the toolbar to some other place on the view, you only have to worry about one frame (the toolbar frame).

    PS: The [toolbar release] call is made because adding a view as a subview increases it’s retain count. To keep the retain count = 1 and avoid memory leaks, this is a best practice. You may have known this already but just throwing it in there.

    Again, your question wasn’t too clear so I’ve answered it based on what I understood from it.

    If this isn’t the solution that you were looking for, maybe you could post some code or explain what you’re trying to do so that we could help you better 🙂

    *******EDIT*******

    correct answer:

    self.view.backgroundColor = [UIColor colorWithRed:35/255.0 green:161.0/255.0 blue:202.0/255.0 alpha:1.0];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello everyone: I have set a custom background for my navigation bar, it's a
I have set up my own custom tableViewCell and want to the background to
i am confused with custom background image in section. i have set an custom
I've got these cells I have set a custom background colour to. The background
I'm customizing UINavigationBar and have to set a custom background image to the navigation
I have a set of custom PropertyDescriptor that I want to add categories too
I have set up some custom symfony project-level settings in the file config/project.yml following
I have set a custom tint color for a UINavigationBar (within a UINavigationController )
I am using RabbitMQ with Celery and I have set some custom routing settings
I want to implement scrolling(horizontal) on my custom view which i have set in

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.