How can I reproduce this shadowing? My problem, that if I use high alpha color or clearColor, there is no drop shadow, if I use low alpha color, I can't see the drop shadow under the plate. As the level of the volume is changing (colorful part) the shadow is moving also, so it is not pure Photoshop.
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
- Adding Shadows at the bottom of a container in flu
I used an UIImageView to provide the shadow. I created an image of 1 pixel wide, by 12 pixels high. The image was black, but the alpha was a gradient from 0.5 at the top to 0.0 at the bottom eg. RGBA 1.0,1.0,1.0,0.5 -> 1.0,1.0,1.0,0.0 - I then placed the UIImageView just below the view needing the shadow, and stretched it horizontally across the width of the view. I have also used this when I needed to change the intensity of the shadow when a scroll view below is scrolling, by changing the UIImageView.alpha value
try something using thoses properies of your view. it might end up with something
it's leaking by the way should CGPathRelease(rect) at the end sorry.
You will have two images one is the colorful image, and the other will be the shadow of it the shadow will expand and increase in width with the expansion of the colorful part
There is no native way to do what you are asking,
After searching and not finding an answer to this question I wrote the following extension in Swift 5:
Usage Example: