I have a UITextView and a WebView side by side and I would like to add a drop shadow to both. This is an iPad app, so they rotate, thus an ImageView under them probably would not work. Any ideas?
+2
A:
UIViews have CALayers, that have some built-in shadow support. Try these properties out:
view.layer.shadowColor
view.layer.shadowOffset
view.layer.shadowOpacity
view.layer.shadowRadius
That may get you what you need pretty quickly. You might need to #import <QuartzCore/QuartzCore.h> to get the compiler to understand what's going on.
jexe
2010-04-03 04:32:01
Was able to figure it out. Thanks!
2010-04-03 05:41:12
Care to post your solution? The accepted answer doesn't seem to work for me as written.
Typeoneerror
2010-04-04 19:31:37
fantastic! If you were a woman I would propose now! :-)thanks!
Digital Robot
2010-06-18 00:08:04
A:
the solution would be like
[myTextBox.layer setShadowColor:[[UIColor blackColor] CGColor]];
[myTextBox.layer setShadowOffset:CGSizeMake(1.0, 1.0)];
[myTextBox.layer setShadowOpacity:1.0];
[myTextBox.layer setShadowRadius:0.3];
but this just works for OS 3.2 and up.
Digital Robot
2010-06-18 00:15:03