使用导航控制器滚动查看onTap手势获取黑色视图

时间:2014-04-25 04:07:31

标签: ios objective-c uinavigationcontroller

我正在使用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];}

0 个答案:

没有答案