开发者

UIWebView doesn't respond to touches when drawn off screen

开发者 https://www.devze.com 2023-02-07 09:03 出处:网络
Ok, so I have a UIScrollView that contains several subviews, the subview I am having difficulties with is the UIWebView. When the webview is displayed on screen without having to scroll down the UIScr

Ok, so I have a UIScrollView that contains several subviews, the subview I am having difficulties with is the UIWebView. When the webview is displayed on screen without having to scroll down the UIScrollView, everything works great 开发者_C百科(figure 1).

Where the problem starts is when the webview is loaded off the screen (figure 2), and scrolling is needed to view it (figure 3). The webview no longer responds to any user interaction.

I've tried some basic things like reloading the webview after the scrollViewDidEndDecelerating delegate is called, but nothing seemed to work. Has anyone encountered this before or have any suggestions on how to fix it?


Turns out this was working perfectly all along. Only problem was I had a wrapper UIView that contained the imageView and webview, but the wrapper wasn't getting resized, so touches outside its bounds weren't being respected. I just want to mention, a webview really shouldn't be placed in a scrollview. I'm only doing this because the webview is being sized according to its content and has scrolling disabled. Plus, there are currently no other views in the documentation that support links without heavy modification.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号