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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:18:50+00:00 2026-05-26T23:18:50+00:00

The back button on custom navigation bar shows half on iPad, it shows properly

  • 0

The back button on custom navigation bar shows half on iPad, it shows properly on iPhone. app supports only portrait mode.

enter image description here

source code,

  UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
if (isPad) {
    backButton.frame = CGRectMake(0, 0, 120, 70);
    [backButton setBackgroundImage:[UIImage imageNamed:@"BackButtonUnpressed-iPad_120X70.png"] forState:UIControlStateNormal];
    [backButton setBackgroundImage:[UIImage imageNamed:@"BackButtonPressed-iPad_120X70.png"] forState:UIControlStateHighlighted];
}else{
    backButton.frame = CGRectMake(0, 0, 60, 35);
    [backButton setBackgroundImage:[UIImage imageNamed:@"BackButtonUnpressed.png"] forState:UIControlStateNormal];
    [backButton setBackgroundImage:[UIImage imageNamed:@"BackButtonPressed.png"] forState:UIControlStateHighlighted];
}

[backButton addTarget:self action:@selector(backButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *buttonItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
self.navigationItem.leftBarButtonItem = buttonItem;
[buttonItem release]; buttonItem = nil;

Please 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-05-26T23:18:50+00:00Added an answer on May 26, 2026 at 11:18 pm

    I resolved the issue, posting the details here so it might be helpful to others

    1] created a UIButton, with custom image.
    2] created a UIView, which will fit properly on UINavigationbar.
    3] added UIButton on UIView.
    4] created UIBarButtonItem with custom view.
    

    here is the code,

        if (isPad) {
            UIView *customView = [[UIView alloc] initWithFrame:CGRectMake(10, 0, 200, 200)];
            UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
            backButton.frame = CGRectMake(0, 90, 120, 70);
            [backButton setBackgroundImage:[UIImage imageNamed:@"BackButtonUnpressed-iPad_120X70.png"] forState:UIControlStateNormal];
            [backButton setBackgroundImage:[UIImage imageNamed:@"BackButtonPressed-iPad_120X70.png"] forState:UIControlStateHighlighted];
            [backButton addTarget:self action:@selector(backButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
            [customView addSubview:backButton];
    
            UIBarButtonItem *buttonItem = [[UIBarButtonItem alloc] initWithCustomView:customView];
            self.navigationItem.leftBarButtonItem = buttonItem;
            [customView release];  customView = nil;
            [buttonItem release]; buttonItem = nil;
        }else{
            UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
            backButton.frame = CGRectMake(0, 0, 60, 35);
            [backButton setBackgroundImage:[UIImage imageNamed:@"BackButtonUnpressed.png"] forState:UIControlStateNormal];
            [backButton setBackgroundImage:[UIImage imageNamed:@"BackButtonPressed.png"] forState:UIControlStateHighlighted];
            [backButton addTarget:self action:@selector(backButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
            UIBarButtonItem *buttonItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
            self.navigationItem.leftBarButtonItem = buttonItem;
            [buttonItem release]; 
            buttonItem = nil;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a custom navigation back button. But when I add this code, my
I add custom button to navigation controller UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@back.png]
I have a custom navigation controller so i made my own back button that
I'd like to replace the back button and the entire navigation bar in my
I'm trying to change the back button to a custom one. If I create
Heyho, I'm building a custom green back button which is being created in the
So, i got this Navigation-based App (with a custom NavigationBar - Category) and I
I have a custom button in an activity. It works fine. I hit back,
I've managed to add a custom background to my navigation bar by using: UIImageView
I have jqgrid and in that I have one custom navigation button to export

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.