首页 > 解决方案 > 快速更改弹出视图控制器cornerRadius

问题描述

我正在尝试更改 popUPViewController 的cornerRadius 但不更改如何更改?同时我还有另一个疑问是否可以更改cornerRadius?

标签: iosobjective-cswift

解决方案


您的问题似乎太宽泛,无法提供具体答案。我试图帮助假设您的需求是:

如果您将新的 iOS 13 演示样式称为“popUPViewController”,则不能更改它的角半径

但是,您可以编写自己的自定义过渡添加您的触摸。是一个开始的好地方。

是的,您可以轻松更改视图的角半径:

yourView.layer.cornerRadius = 10 //Whatever radius you'd want
yourView.layer.masksToBounds = true //This line is important. Doing this will restrain yourView's layer and sublayers to the cornered mask

您还可以另外指定角以应用半径:

yourView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] //This will round the top-left and top-right corners

推荐阅读