How to refresh a UIWebView by a “pull down and release” gesture?

前端 未结 4 440
夕颜
夕颜 2020-12-25 08:52

I know that this is possible in the Tweetie for iPhone or the xkcd iPhone app, but they are using a table. Any idea if this can be done for a simple UIWebView a

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-25 09:22

    To get a reference for the UIScrollView in UIWebView, simply search it by iterating trough subviews.

    for(id eachSubview in [webView subviews]){
            if ([eachSubview isKindOfClass:[UIScrollView class]]){
                scrollView = eachSubview;
                break;
            }
    }
    

    After that you can easily wire up things to your EGORefreshTableHeaderView interface with the UIWebView and the UIScrollView delegate callbacks.

提交回复
热议问题