0

我想获得一个手势来重新加载我编码的应用程序的网页。截至目前,手势正在使用UIGestureRecognizer。我已经成功地能够编码,当我刷卡时,我有一个UILabel变化。我想用这个手势来重新加载网页。目前,我在我的m文件中有这样的事情导致这种情况发生。链接手势重新加载UIWebView

- (void)ScreenWasSwiped 
{ 
    [swipe setText:@"This is working"]; 
} 

viewdidload

UISwipeGestureRecognizer *swipedown = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector (ScreenWasSwiped)]; 
swipedown.numberOfTouchesRequired = 1; 
swipedown.direction=UISwipeGestureRecognizerDirectionDown; 
[self.view addGestureRecognizer:swipedown]; 

我怎样才能改变这种做法,我可以用相同的姿态重新加载浏览器?

在此先感谢。

回答

0

在您的方法ScreenWasSwiped中,在您的UIWebView实例上使用调用reload。它会看起来像这样:

-(void)ScreenWasSwiped 
{ 
    [myWebView reload]; 
} 
+0

这样做的窍门!谢谢! – Ash 2012-04-03 14:22:40

+0

太棒了!我很高兴它的工作 - 你能标记答案为“接受”? – 2012-04-03 14:46:08