iOS7上UIWebView可以左右滑動
經(jīng)過無數(shù)嘗試發(fā)現(xiàn),只要UIWebView的寬比屏幕的寬小一些,1個點左右,但這樣能看到UIWebView不是全屏,想讓寬度差更小些,經(jīng)過幾次實驗,我的最小值為0.5,左右各。25個點。
在iOS8之后的系統(tǒng)上,UIWebView的寬等于屏幕寬也不會左右滑動。
WebActionDisablingCALayerDelegate類找不到相應(yīng)的方法實現(xiàn)
在加載UIWebView過程中,發(fā)現(xiàn)有時會崩潰,找不到WebActionDisablingCALayerDelegate類的一些方法實現(xiàn)。
自己動手加,寫了一個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 這個私有類添加方法,在后面的一次提交審核過程中,ipa文件提交失敗:引用私有API(還是私有類,記不得了)。所以建議不要采用。否則會審核通不過如下:
Guideline 2.5.1 - Performance - Software Requirements
Your app uses or references the following non-public APIs:
PrivateFrameworks/WebCore.framework (WebActionDisablingCALayerDelegate)
The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change.
Continuing to use or conceal non-public APIs in future submissions of this app may result in the termination of your Apple Developer account, as well as removal of all associated apps from the App Store.
作者:學(xué)習(xí)無底
鏈接:http://www.lxweimin.com/p/c23085f0a758
來源:簡書
著作權(quán)歸作者所有。商業(yè)轉(zhuǎn)載請聯(lián)系作者獲得授權(quán),非商業(yè)轉(zhuǎn)載請注明出處。