📱

UIViewの特定の角だけ丸くしたいとき

2021/04/29に公開

UIViewの特定の角を丸くしたいとき。

簡単な方法:

ref: https://www.hackingwithswift.com/example-code/calayer/how-to-round-only-specific-corners-using-maskedcorners

UIView.Layer.maskedCorners を指定するだけ

UIBezierPathを使う方法

ref:
https://stackoverflow.com/questions/10167266/how-to-set-cornerradius-for-only-top-left-and-top-right-corner-of-a-uiview

Discussion