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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:17:21+00:00 2026-06-10T07:17:21+00:00

Hi guys the code below makes a little gray rectangle with a dark border.

  • 0

Hi guys the code below makes a little gray rectangle with a dark border. The corner radio isn’t working and I cannot figure out why, I’ve tried applying maskToBounds = true, but that just hides the whole object…

How can I achieve this? Thanks

CGRect r = CGRectMake(conX, conY, 220, 50);
    UIBezierPath* conPath = [UIBezierPath bezierPathWithRect:r];
    CAShapeLayer* conLayer = [CAShapeLayer layer];
    conLayer.path = conPath.CGPath;
    conLayer.cornerRadius = 5.0;
    UIColor *bg = [UIColor colorWithWhite:1 alpha:0.7];
    [conLayer setFillColor:bg.CGColor];
    [conLayer setStrokeColor:[UIColor grayColor].CGColor];
    [[self layer] addSublayer:conLayer];
  • 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-10T07:17:23+00:00Added an answer on June 10, 2026 at 7:17 am

    UPDATE:

    You can simply use UIBezierPath( roundedRect: CGRect, cornerRadius: CGFloat).CGPath to create your round rect path


    I recommend using a round rect path instead:

    CGRect r = { .size = { 220.0f, 50.0f } } ;
    
    CAShapeLayer * layer = [ CAShapeLayer layer ] ;
    layer.path = CGPathCreateRoundRect( r, 5.0f ) ;
    

    where CGPathCreateRoundRect() is

    CGPathRef CGPathCreateRoundRect( const CGRect r, const CGFloat cornerRadius )
    {
        CGMutablePathRef p = CGPathCreateMutable() ;
    
        CGPathMoveToPoint( p, NULL, r.origin.x + cornerRadius, r.origin.y ) ;
    
        CGFloat maxX = CGRectGetMaxX( r ) ;
        CGFloat maxY = CGRectGetMaxY( r ) ;
    
        CGPathAddArcToPoint( p, NULL, maxX, r.origin.y, maxX, r.origin.y + cornerRadius, cornerRadius ) ;
        CGPathAddArcToPoint( p, NULL, maxX, maxY, maxX - cornerRadius, maxY, cornerRadius ) ;
    
        CGPathAddArcToPoint( p, NULL, r.origin.x, maxY, r.origin.x, maxY - cornerRadius, cornerRadius ) ;
        CGPathAddArcToPoint( p, NULL, r.origin.x, r.origin.y, r.origin.x + cornerRadius, r.origin.y, cornerRadius ) ;
    
        return p ;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

guys, I would like to you evaluate next code below. As you see, I
Hi guys I have my endless page js code working great but for some
hey guys, i have very small issue please see the code below // this
Hi guys I'm in an emergency here. My code was working FINE for a
I got help with the code below from you guys on forum and the
Hello guys look to my code I'm trying to make a program which asks
Hie guys i need help with my code. I have a form where a
Hey guys this is my html code: <div class=nakupy> <li class=icn_kategorie><a href=#>Nákupy</a> <div class=sub_menu>
Hi guys I have the following code and and I want it to last
Hello guys I can't provide the code but you can see it on the

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.