【发布时间】:2011-12-13 19:55:25
【问题描述】:
我想要做的是在导航栏上方放置一个滚动视图,但仍然让导航栏获得触摸输入。
我查看了响应者链,但条似乎不在其中。
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];
}
【问题讨论】:
标签: ios uinavigationcontroller uiscrollview uinavigationbar