iOS7上UIWebView可以左右滑動
- 經(jīng)過無數(shù)嘗試發(fā)現(xiàn),只要UIWebView的寬比屏幕的寬小一些,1個(gè)點(diǎn)左右切心,但這樣能看到UIWebView不是全屏飒筑,想讓寬度差更小些,經(jīng)過幾次實(shí)驗(yàn)绽昏,我的最小值為0.5协屡,左右各。25個(gè)點(diǎn)全谤。
- 在iOS8之后的系統(tǒng)上肤晓,UIWebView的寬等于屏幕寬也不會左右滑動。
WebActionDisablingCALayerDelegate類找不到相應(yīng)的方法實(shí)現(xiàn)
- 在加載UIWebView過程中认然,發(fā)現(xiàn)有時(shí)會崩潰补憾,找不到WebActionDisablingCALayerDelegate類的一些方法實(shí)現(xiàn)。
- 自己動手加卷员,寫了一個(gè)UIWebView的category盈匾,.m代碼如下:
+ (void)load{
// "v@:"
Class class = NSClassFromString(@"WebActionDisablingCALayerDelegate");
class_addMethod(class, @selector(setBeingRemoved), setBeingRemoved, "v@:");
class_addMethod(class, @selector(willBeRemoved), willBeRemoved, "v@:");
class_addMethod(class, @selector(removeFromSuperview), willBeRemoved, "v@:");
}
id setBeingRemoved(id self, SEL selector, ...)
{
return nil;
}
id willBeRemoved(id self, SEL selector, ...)
{
return nil;
}
修正
為 WebActionDisablingCALayerDelegate 這個(gè)私有類添加方法,在后面的一次提交審核過程中子刮,ipa文件提交失斖啤:引用私有API(還是私有類,記不得了)挺峡。所以建議不要采用葵孤。