我正在使用ScrollView
测试onTap手势并发现它非常直接实现,我遇到的问题是下一步是推动下一个ViewController
,它会生成一个带有navigation bar
的黑屏或生成屏幕,但是当我触摸后退按钮时,它会再次生成此屏幕。
我的viewdidload如下:
(void)viewDidLoad{
[super viewDidLoad];
[scroller setContentSize:CGSizeMake(320, 1500)];
[scroller setScrollEnabled:YES];
UITapGestureRecognizer *gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onTap)];
gestureRecognizer.delegate = self;
[scroller addGestureRecognizer:gestureRecognizer];
// Do any additional setup after loading the view, typically from a nib.
}
和onTap是
-(void)onTap{
ViewController *viewController = [[ViewController alloc] init];
[self.navigationController pushViewController:viewController animated:YES];}