I'm trying to create a shadow around a simple UIView object which is added on top of a UIViewController's view. what's the most straight forward way of doing this?
相关问题
- Image loads in simulator but not device?
- Unable to change UISearchBar cancel button title c
- UIModalTransitionStyleFlipHorizontal flips Vertica
- How to take a layer's snapshot with mask layer
- Xcode4 templates now use underscore on iVars?
相关文章
- Xcode: Is there a way to change line spacing (UI L
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- How to get a CGImageRef from Context-Drawn Images?
- Why are my UIView layer properties not being set w
- create UIImageView
- Can I add a border to an SKSpriteNode, similar to
- How to show the keyboard for a UIView
- textFieldDidBeginEditing: for more than one textfi
It took me some time to figure it out. Code works perfect but you should import quartz
First, be sure to import the Quartz Core library:
Next, add the following lines to set up the shadow's properties:
Keep in mind that if you have that view's clipsToBounds property set to YES, the shadow won't appear.