iOS: Remove the Default Shadow around a UIWebView
I want a UIWebView in my app, as I had one for a previous app and it’s a great way to get your text looking a lot more interesting than in a simple textField.
This time it was for an iPad app and I really noticed that line / border around the webview and having seen a tweet from Mike Rundle (@flyosity) he posted a little snippet to remove that default shadow around a UIWebView.
The image below shows you the difference in appearance, it’s miles better and am so happy I found it.
The code is here:
for( UIView *view in [self.webView subviews] ) {
if( [view isKindOfClass:[UIScrollView class]] ) {
for( UIView *innerView in [view subviews] ) {
if( [innerView isKindOfClass:[UIImageView class]] ) {
innerView.hidden = YES;
}
}
}
}
I love finding little gems of code like this that make your app just that little bit more polished.
The original posted link is here http://cl.ly/1a6H
No related posts.


really helpful, thanks for documenting this… we were having trouble w/ this as well.