1
我正在使用带有页眉和页脚的UITableView,整个TableView里面都有水平的UIScrollViews。我将它用作锁定标题功能,就像在Excel中一样。在没有UserInteraction的情况下在滚动视图中按下一个按钮
在UITableview Header和UITableView Footer中的UIScrollView上禁用了UserInteraction,并且只有在正文滚动时才会滚动。
在我的头文件中,我现在有一个位于UIScrollViews ContentView中的按钮,我需要能够与它进行交互,而不是......过去有没有人遇到过这种情况?
大部分不需要的代码已被省略......
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UITableViewHeaderFooterView *viewHeader;
UIButton *flow;
viewHeader = [[UITableViewHeaderFooterView alloc] initWithFrame:CGRectMake(0, 1, self.tableview.frame.size.width, 48)];
UIView *thisContentView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, contentWidth, 48)];
flow = [[UIButton alloc] initWithFrame:CGRectMake(flowRate.frame.origin.x + flowRate.frame.size.width + 5, 14, colWidth1, 20)];
[flow.imageView setImage:[UIImage imageNamed:@"ic_flow"]];
flow.imageView.contentMode = UIViewContentModeScaleAspectFit;
[flow setContentMode:UIViewContentModeScaleAspectFit];
[UniversalMethods tintImageviewInButton:flow withColor:BRIGHT_BLUE];
[flow addTarget:self action:@selector(showSortingAlert:) forControlEvents:UIControlEventTouchUpInside];
[thisContentView addSubview:flow];
[thisScrollview addSubview:thisContentView];
thisScrollview.contentSize = thisContentView.frame.size;
thisScrollview.tag = scrollTag;
[thisScrollview setUserInteractionEnabled:false];
[viewHeader addSubview:thisScrollview];
return viewHeader;
}
谢谢你......这很好 – Burnie777