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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:46:49+00:00 2026-06-10T08:46:49+00:00

I have a Master-Details project setup and running in XCode with no problems at

  • 0

I have a Master-Details project setup and running in XCode with no problems at all and everything works fine. However, when I attempt to round the top right and left corners of the NavigationBar it has a very strange effect. It basically, offsets the ‘touch’ response of the ‘back’ left button on the details view.

The button still works, but it seems that the iPhone can only pick up the user’s touch when they click just below the NavigationBar and not the button itself.

The code I have is:

// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    UIColor *color = [UIColor darkGrayColor];
    UIImage *img = [UIImage imageNamed:@"nav-bar"];
    [img drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
    self.tintColor = color;

    // Create mask to round corners
    CGRect bounds = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:bounds byRoundingCorners:(UIRectCornerTopLeft | UIRectCornerTopRight) cornerRadii:CGSizeMake(10.0, 10.0)];

    CAShapeLayer *maskLayer = [CAShapeLayer layer];
    maskLayer.frame = bounds;
    maskLayer.path = maskPath.CGPath;

    // Apply mask to navigation bar
    [self.layer addSublayer:maskLayer];
    self.layer.mask = maskLayer;

    // Apply logo to navigation bar
    UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logo"]];
    self.topItem.titleView = imageView;
}

Here is a screen shot of what I mean, button only responses when I touch where the arrow is pointing:

Touch Point

— UPDATE —

After some testing I’ve worked out the problem is with the ‘self.layer.mask = maskLayer’ line. I have refactored the code and tested in another project that just uses xib files and not story boards, and dont have any problems, but its still not working in the current project.

CGRect bounds = CGRectMake(0, 0, navigationController.navigationBar.bounds.size.width,
                                   navigationController.navigationBar.bounds.size.height);
        UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:bounds byRoundingCorners:(UIRectCornerTopLeft | UIRectCornerTopRight) cornerRadii:CGSizeMake(10.0, 10.0)];

        CAShapeLayer *maskLayer = [CAShapeLayer layer];
        maskLayer.frame = bounds;
        maskLayer.path = maskPath.CGPath;

        // Apply mask to navigation bar
        //navigationController.navigationBar.layer.mask = maskLayer;
        [navigationController.navigationBar.layer addSublayer:maskLayer];
        navigationController.navigationBar.layer.mask = maskLayer;
  • 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-10T08:46:51+00:00Added an answer on June 10, 2026 at 8:46 am

    use self.bounds instead of self.frame. You probably want to draw relatively to your own coordinates system and not relatively to your own parent view.

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

Sidebar

Related Questions

All respected, I have a Master detail project asp.net (sql data) project in which
I'm using Xcode 4.3.3 and Storyboards for this project. I have a master view
I have 2 domains .. master and details. Master{ String masterName; static hasMany=[details:Detail] }
I have a master detail Application in xCode. In Master View Controller an Array
I have an app with a Master-Details view. When you select an item from
I have a simple app I am messing around with its a basic Master/Details
I have a new ASP.NET MVC project (my first), and I had been running
I have a working website website project in visual studio. I can view all
i have a self referencing table called project that has a master detail relationship
I have the following view and table in my project, vw_get_arabia_upod_full_details arabia_upod_item_avalability_master I want

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.