简体   繁体   English

快速更改弹出视图控制器cornerRadius

[英]change popover viewcontroller cornerRadius in swift

i am trying change cornerRadius of popUPViewController but not change how to change that?我正在尝试更改 popUPViewController 的cornerRadius 但不更改如何更改? at the same time i have another doubt also is it possible to change cornerRadius??同时我还有另一个疑问,是否可以更改cornerRadius??

Your question seems too broad to help with a specific answer.您的问题似乎过于宽泛,无法提供具体答案。 I'm trying to help assuming what your needs are:我试图帮助假设您的需求是什么:

If you're referring to the new iOS 13 presentation style as "popUPViewController", you CANNOT change the corner radius of it如果您将新的 iOS 13 演示样式称为“popUPViewController”,则无法更改它的圆角半径

But, you can write your own custom transition adding your touches to it.但是,您可以编写自己的自定义过渡添加您的触摸。 This is a nice place to get started with. 是一个开始的好地方。

And yes, you can easily change the corner radius of a view:是的,您可以轻松更改视图的角半径:

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

You can additionally also specify corners to apply the radius with:您还可以另外指定角以应用半径:

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

尝试做 popupViewController.layer.cornerRadius = 10.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM