Articles Tagged 'thefirst'

iPhone: Delete the shadow effect when scrolling a UIWebView

In this last period I worked on three applications for Apple iPhone, virtually simultaneously. Two have already been approved by Apple and are located on the App Store: thefirst and iMakeLove .

TheFirst iMakeLove

In both applications have adopted the use of an object UIWebView to display the instructions.
The object UIWebView has ilevato really convenient in this case. It allowed me to quickly view and a nice text, images, and accompanied, if anything else was displayed on a Web page (Flash on iPhone not included).

TheFirst

The object UIWebView is truly versatile and requires very few settings to be used. The only defect is the presence of a mysterious shadow that appears when you make a scroll out of the area of ​​control is at the bottom than at the top:

UIWebView Shadow

After much research I realized that this behavior depends on the SDK, especially the latest updates. And Apple has not released any official statement on how to remove it, on the contrary, he rejected as code is not allowed a series of hacks that make use of sensitive functions, or documenting. Eventually I gave up, both for time and because the solutions seemed all out of the box Apple.
Fortunately I got the solution, I hope fairly regular basis, which seems to solve the problem (thanks to Adolfo ):

1
2
3
4
5
6
/ / WebView is the control UIWebView
[ webView.subviews objectAtIndex : 0 ] ; id = scroller [webView.subviews objectAtIndex: 0];

UIView * subView in [ scroller subviews ] ) for (UIView * subView in [scroller subviews])
subView class ] description ] isEqualToString : @ "UIImageView" ] ) if ([[[subView class] description] isEqualToString: @ "UIImageView"])
; subView.hidden = YES;

As pointed out by Adolfo this is still a hack that could stop working with future releases of the SDK.

More ...


Stop SOPA