0

我想将推送导航放入滑动中。

我想在滑动手势上调用这个方法。

- (IBAction)MakeADifferenceButtonPressed:(id)sender {
    MakeADifferenceViewController *makeADifferenceView = [[MakeADifferenceViewController alloc] initWithNibName:@"MakeADifferenceViewController"  bundle:nil];
    [self.navigationController pushViewController:makeADifferenceView animated:YES];
    [makeADifferenceView release];
}

任何人请帮助我。我是 iphone 的新手。

4

1 回答 1

2

使用此代码在您当前的 UIView 中添加 UISwipeGestureRecognizerDirectionLeft

UISwipeGestureRecognizer *swipeleft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(MakeADifferenceButtonPressed:)];
swipeleft.direction = UISwipeGestureRecognizerDirectionLeft;
[self.view addGestureRecognizer:swipeleft];
于 2013-01-17T06:07:35.020 回答