Its a UIView containing a UIImageview and label. Is there any way to create a uiview with shadow like this?
Thanks in advance,
Joe
I don't believe iOS supports shadows. They are too CPU-intensive. You could render the image beforehand in an image editor, and use it as a static image. If you save it as a png with an alpha channel, you can even get the shadow to draw over the background.
Bear in mind that semi-transparent content really bogs down iOS devices though. That's why iOS doesn't support shadows in the first place. The graphics hardware isn't fast enough to render shadows without lagging.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
Sure you can do shadows. This code here will create a view with a drop shadow. It won't do the curl effect you're after but I'm sure it can be tweaked.
Sure you can do shadows. This code here will create a view with a drop shadow. It won't do the curl effect you're after but I'm sure it can be tweaked.
You can create just any shape with a background of clearColor and them apply the drop shadow effect to it. You can remove the border stuff.
Don't forget to import QuartzCore!
Oops, you're right. My bad. Shadows were added in iOS 3.2. The last time I tried to use them, it was for an app that had iOS 3.0 as the minimum supported iOS, so I couldn't use them.
It doesn't help that the Zarra/Long Core Animation book I'm reading explicitly says that shadows are not supported. I guess it's based on the 3.0 APIs. That's actually more than a little frustrating. I wish authors would explicitly state the OS version their books are based on. iOS is changing so fast that the odds are, by the time you publish a book, the APIs you are documented have been updated. I looked pretty hard in the Zarra/Long book, and I could not find the version of iOS it was written for anywhere.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.