Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am using the following code to show the pointer like triangle view.
Objective-C
UIView *triangleView = [[UIView alloc] initWithFrame:CGRectMake(70.0f,58.0f, self->_createAccountView.frame.size.width ,20.0f)];
   UIBezierPath* trianglePath = [UIBezierPath bezierPath];
   [trianglePath moveToPoint:CGPointMake(0, 0)];
   [trianglePath addLineToPoint:CGPointMake((self->_createAccountView.frame.size.width/7) -8, (self->_createAccountView.frame.size.height/4))];
   [trianglePath addLineToPoint:CGPointMake((self->_createAccountView.frame.size.width/5) , 0)];
   [trianglePath closePath];
   trianglePath.lineJoinStyle = kCGLineJoinRound;

   CAShapeLayer *triangleMaskLayer = [CAShapeLayer layer];
   [triangleMaskLayer setPath:trianglePath.CGPath];
   triangleView.backgroundColor = [UIColor colorWithRed:1.00 green:1.00 blue:1.00 alpha:1.0];

   triangleView.layer.mask = triangleMaskLayer;
   [self->_AccountView addSubview:triangleView];

This works fine but I want the pointing edge of the triangle view to be rounded. How can make it rounded? Any help is appreciated!

What I have tried:

I have tried the makeing the edges rounded using the addArcWithCenter,linecap,linejoin.
Posted
Updated 8-Jun-16 0:19am
v2
Comments
Sergey Alexandrovich Kryukov 8-Jun-16 10:41am    
I'm afraid there are no such things. Most likely, you will need to modify your Bezier objects by adding more points, of additional fragments math matching first-derivatives at the ends, to couple them smoothly.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900