Jes*_*sse 2 uiwebview uiscrollview ios
在iOS5中,这很好用:
[descriptionWebView.scrollView setScrollEnabled:NO];
Run Code Online (Sandbox Code Playgroud)
但是在任何低于5的iOS中它都失败了:
[UIWebView scrollView]: unrecognized selector sent to instance 0x791f9e0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIWebView scrollView]: unrecognized selector sent to instance 0x791f9e0'
Run Code Online (Sandbox Code Playgroud)
你可以做这种测试,不需要你检查它是哪个iOS版本.
if([descriptionWebView respondsToSelector:@selector(scrollView)]){
[descriptionWebView.scrollView setScrollEnabled:NO];
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2662 次 |
| 最近记录: |