1

Question : How to change only left side radius of ui button??

Problem : i have a 3 uibutton in my view. and i want to change only left side radious of uibutton here is my code

 btnsetting.layer.cornerRadius = 5
btnsaved.layer.cornerRadius = 5
btnall.layer.cornerRadius = 5

but its give radius to both side..

What i want to do: i want this kind of uibutton

Community
  • 1
  • 1
Govind Rakholiya
  • 362
  • 3
  • 21

1 Answers1

-1

You will have to:

  • Create a CAShapeLayer
  • Set its path to be a CGPathRef based on view.bounds but with only two rounded corners (probably by using +[UIBezierPath bezierPathWithRoundedRect:byRoundingCorners:cornerRadii:])
  • Set your view.layer.mask to be the CAShapeLayer

credit: https://stackoverflow.com/a/10167334/2303865

Community
  • 1
  • 1
a4arpan
  • 1,727
  • 2
  • 22
  • 37