I just want the easiest way to make a reflection under a UIImageVies that is easily managable.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- C# how to invoke a field initializer using reflect
- How can I implement password recovery in an iPhone
相关文章
- 现在使用swift开发ios应用好还是swift?
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- How can I add media attachments to my push notific
- How do you detect key up / key down events from a
- Are GetCallingAssembly() and GetExecutingAssembly(
Just use the sample code in the the iPhone SDK library
Update: Link now updated to new location
I wrote an article on how to generate reflections of any UI element or group of elements. The canned technique can be dropped into your project and is really easy to use. Source code and the article can be found at http://aptogo.co.uk/2011/08/no-fuss-reflections/
The easiest way is to do it by hand in Photoshop! (seriously - if that's practical just do that).
Otherwise you'll need to make an inverted copy of the image (or at least the bottom half) to place below the real one, overlaid with a gradient from black (assuming your background is black) with alpha=1 to alpha=0.
If you need to place it over arbitrary backgrounds it's a little more complex as you'll have to apply the gradient from alpha = 0 to alpha = 1 to your inverted image. I knocked up some code once to do it - will try and dig it out later when I get to my Mac, if nobody else has come up with anything sooner.
As Phil says, you can have a "reflected" UIImageView instance:
And then, in your implementation, something like this