我想将推送导航放入滑动。
我想在滑动手势上调用此方法。
- (IBAction)MakeADifferenceButtonPressed:(id)sender {
MakeADifferenceViewController *makeADifferenceView = [[MakeADifferenceViewController alloc] initWithNibName:@"MakeADifferenceViewController" bundle:nil];
[self.navigationController pushViewController:makeADifferenceView animated:YES];
[makeADifferenceView release];
}
任何人请帮助我。我是iphone的新手。
答案 0 :(得分:2)
使用此代码在您当前的UIView中添加UISwipeGestureRecognizerDirectionLeft
UISwipeGestureRecognizer *swipeleft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(MakeADifferenceButtonPressed:)];
swipeleft.direction = UISwipeGestureRecognizerDirectionLeft;
[self.view addGestureRecognizer:swipeleft];