gpt4 book ai didi

ios - UIModalPresentationFormSheet 的圆角

转载 作者:可可西里 更新时间:2023-11-01 06:18:15 27 4
gpt4 key购买 nike

如果这是一个明显的问题,请原谅我,我是个新手。

我有一个模态视图,我设置了自定义大小和圆角:

- (void)viewWillLayoutSubviews{

[super viewWillLayoutSubviews];
self.view.superview.bounds = CGRectMake(0, 0, 600, 450);
self.view.layer.cornerRadius = 60.0;
}

但是我发现当我绕过视角角时,我在它的边缘出现了这种灰色(好像它后面还有其他东西):(见图)。

enter image description here

如何去除这些灰色边缘,使其显示正常的背景内容?我试过添加

self.view.layer.masksToBounds = YES;

然而,这仍然会产生与上述相同的效果。

谢谢,

最佳答案

- (void)viewWillLayoutSubviews
{
[super viewWillLayoutSubviews];
self.view.superview.bounds = CGRectMake(0, 0, 600, 450);
self.view.superview.layer.cornerRadius = 60.0;
self.view.superview.layer.masksToBounds = YES;
}

我认为你应该设置 superView 的圆角半径。

关于ios - UIModalPresentationFormSheet 的圆角,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20609717/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com