我正在尝试为我正在编码的应用重新加载网页。截至目前,手势正在使用UIGestureRecognizer
。我已成功编写代码,以便在刷卡时我有UILabel
更改。我想用这个手势来重新加载网页。目前,我在我的m文件中有类似的东西导致这种情况发生。
- (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 :(得分:0)
在名为ScreenWasSwiped
的方法中,在UIWebView实例上使用call reload
。它看起来像这样:
-(void)ScreenWasSwiped
{
[myWebView reload];
}