Just two rounded corners? [duplicate]
问题 This question already has answers here : Rounded UIView using CALayers - only some corners - How? (14 answers) Closed 6 years ago . In my iPad app, I want a second view to appear within the main when the user clicks a button. The new view will be smaller than the first, and darken the background when it is displayed. I want the top two corners of the new view to appear rounded, but using cornerRadius sets all of them rounded. How can I make just two corners rounded? 回答1: You have to do this