开发者

When using a view with a webView in, the shake gesture is not always detected

This is my first post and I have looked all over for a week or so now so I'm not sure if there is an answer out there or not.

I have an iPhone application (my first one)开发者_运维技巧 that has a view that includes a UIWebView.

The view responds to the shake gesture and then loads a modal view controller that includes navigation buttons for the webView that depend on whether the webView can go back/forward etc.

The problem is that the shake gesture works fine most of the time but, depending on what is displayed in the webView, the shake sometimes fails to register, whenever it fails I just have to locate and tap on a blank area of the UIWebView or click on the top navigation bar and shake again and this will usually register.

What can be causing this? Is it something to do with UIWebView?


OK, well i've found the solution for this.

Add the following code to the view that contains the UIWebView

[self becomeFirstResponder];

i chose to put this at the very end of the - (void)webViewDidFinishLoad:(UIWebView *)webView method

This seems to work OK on the testing i've done so far.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜