IOS4.x下UIWebView的显示问题
苹果太不善待开发者了。开发者交钱就不说,还总是纠结在过去版本的库的bug!
----------
IOS4.x下面,如果UIWebView加载的页面比较大,可能会出现页面不显示的问题。解决如下:
if(!UIU_IsIOS5)
{//fix a BT bug at IOS4.x !!!
UIScrollView * scroll = [webView.subviews objectAtIndex:0];
NSArray * scrollSubviews = scroll.subviews;
int countSubviews = [scrollSubviews count];
UIView * v;
for(int i = countSubviews - 1; i > 0; i--)
{
v = [scrollSubviews objectAtIndex:i];
if([v isKindOfClass:NSClassFromString(@"UIWebBrowserView")])
{
[v setNeedsDisplay];
break;
}
}
}
其中,
#define UIU_IsIOS5 ([[[UIDevice currentDevice] systemVersion] intValue] >= 5)