我要做的是在scrollBar上方放置一个滚动视图,但仍然有导航栏获取触摸输入。
我看了响应链,看起来似乎没有。
FowardScrollView* _scrollView = [[FowardScrollView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 480.0f, 40.0f)];
UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController: [[UIViewController alloc] init] ];
navController.topViewController.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"hello world" style:UIBarButtonItemStylePlain target:nil action:nil];
[navController.view setFrame:self.view.frame];
[self.view addSubview: navController.view];
[self.view addSubview: _scrollView];
然后在前视图的imp
中-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[self.nextResponder touchesBegan:touches withEvent:event];
// [super touchesBegan:touches withEvent:event];
}
答案 0 :(得分:0)
如果您需要了解实际的触摸事件,比如说,将其转发到导航栏,您可以始终覆盖UIApplication
及其触摸处理方法。