gpt4 book ai didi

ios - 从 ViewController 移除阴影

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:00:14 24 4
gpt4 key购买 nike

我使用以下代码显示阴影。

UIBezierPath *shadowPath = [UIBezierPath bezierPathWithRect:CGRectMake(317, 0, 1, self.navigationController.view.frame.size.height)];
self.navigationController.view.superview.layer.masksToBounds = NO;
self.navigationController.view.layer.shadowColor = [UIColor blackColor].CGColor;
self.navigationController.view.layer.shadowOffset = CGSizeMake(3, 0); /*Change value of X n Y as per your need of shadow to appear to like right bottom or left bottom or so on*/
self.navigationController.view.layer.shadowOpacity = 0.5f;
self.navigationController.view.layer.shadowPath = shadowPath.CGPath;

我想删除这个阴影。我尝试了一些方法但没有用?感谢您的帮助。

最佳答案

尝试将 balckColor 替换为 clearColor 并将 Opacity 替换为 0.0

self.navigationController.view.layer.shadowColor = [UIColor clearColor].CGColor;
self.navigationController.view.layer.shadowOpacity = 0.0f;

关于ios - 从 ViewController 移除阴影,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37320618/

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