简体   繁体   中英

Corner Radius leaving circular line

After setting border width and corner radius of UIView getting black circular line

在此处输入图片说明

Code:

afterSelectFrameView.layer.borderWidth=[slide value];
afterSelectFrameView.layer.cornerRadius=[slide value];

Apply mask to bounds

[imageView.layer setMasksToBounds:YES];
[imageView.layer setCornerRadius:5.0];

setting the border is not necessary, but here is an option for you.

[imageView.layer setBorderWidth:0.0f];

I use the code below (it is part of a ViewUtilities library) to round the corners on any view.
You could modify it to add parameters for other radii, colors, etc.

+(void)AdjustViewEdges:(UIView*)view
{
   [view.layer setBorderColor: [[UIColor blackColor] CGColor]];
   [view.layer setBorderWidth: 1.0];
   [view.layer setCornerRadius:12.0f];
   [view.layer setMasksToBounds:YES];  
   view.backgroundColor = [UIColor colorWithRed:.99 green:0.99 blue:0.99 alpha:1.0];
}

// You will need this as well
#import <QuartzCore/QuartzCore.h>

I don't believe it is giving me the lines you are seeing...but my background colors were different so they may be hidden...

Was this helpful?

Use it like this

afterSelectFrameView.layer.borderWidth=0.0;

afterSelectFrameView.layer.cornerRadius=[slide value];

Happy coding..........

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM