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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:40:05+00:00 2026-05-27T22:40:05+00:00

I created my own subclass of UINavigationBar in order to enable custom background that

  • 0

I created my own subclass of UINavigationBar in order to enable custom background that is taller than 44pxs.

I did it by overriding these two methods:

-(void) drawRect:(CGRect)rect
{
    [self.backgroundImage drawInRect:CGRectMake(0, 0, self.backgroundImage.size.width, self.backgroundImage.size.height)];
}

- (CGSize)sizeThatFits:(CGSize)size 
{
    CGRect frame = [UIScreen mainScreen].applicationFrame;
    CGSize newSize = CGSizeMake(frame.size.width , self.backgroundImage.size.height);
    return newSize;
}

And this is the result:

Custom bar with custom height

Now, my problem as you can see is that all the UIBarButtonItem’s (and the titleView) are placed at the bottom of the navigation bar.

I would like them to be pinned to the top of the bar (with some padding of course).
What to I need to override to achieve that?

Thanks!

EDIT:

This is the solution that I used:

-(void) layoutSubviews
{
    [super layoutSubviews];
    for (UIView *view in self.subviews)
    {
        CGRect frame = view.frame;
        frame.origin.y = 5;
        view.frame = frame;
    }
}

Does the trick for idle state, still have some weird behavior on push and pop items.

  • 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-27T22:40:06+00:00Added an answer on May 27, 2026 at 10:40 pm

    Try to override layoutSubviews: call [super layoutSubviews] inside and then reposition the items.

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

Sidebar

Related Questions

I created my own custom date picker consisting of an ASP TextBox, Button, and
I've created my own view by creating a subclass of the SurfaceView class. However
I am creating a subclass of UIButton in order to create my own customized
I've created my own UIPrintPageRenderer subclass and in my overload for DrawContentForPage(), I draw
I created a custom UIView subclass, and would prefer to not layout the UI
Hope you can help. I have created my own Custom UIView and I'm trying
According to this answer I want to create my own subclass of Array QArray
I've trouble with actionListener. I created own simple dialog, which has only two JButtons
I created my own class but when I try to instantiate it I run
I created my own behavior as follows: public class BoundaryExceptionHandlingBehavior : IInterceptionBehavior { public

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.