swift – UIView Shadow Damaged on iOS 16


in iOS 15 my shadow on my UIView appears like this:
enter image description here

Nonetheless, now, the UIView has a internal shadow utilizing the identical code. I am very confused. Cannot learn how to disable to internal shadow.
That is what the shadow appears like in iOS 16:

enter image description here

That is the code:

        float bottomShadowWidth = bottomBar.body.measurement.width;
        CGRect bottomShadowRect = CGRectMake(0.0f, 0.0f, bottomShadowWidth, bottomShadowHeight);
        bottomBar.layer.masksToBounds = NO;
        bottomBar.layer.shadowColor = [UIColor blackColor].CGColor;
        bottomBar.layer.shadowOpacity = 0.5f;
        bottomBar.layer.shadowRadius = 10.0;
        bottomBar.layer.shadowPath = CGPathCreateWithRect(bottomShadowRect, nil);

Leave a Reply

Your email address will not be published.