Create a rectangle with just two rounded corners in swift?

后端 未结 15 3008
南笙
南笙 2020-11-28 03:14

I need to create a rectangle that have just two rounded corners in swift (Objective C code also ok).

At the moment my code is creating two rectangles with



        
15条回答
  •  长情又很酷
    2020-11-28 03:40

    Here is what you do in Swift 2.0

    var maskPath = UIBezierPath(roundedRect: anyView.bounds,
            byRoundingCorners: [.BottomLeft, .BottomRight],
            cornerRadii: CGSize(width: 10.0, height: 10.0))
    

提交回复
热议问题