J'utilise un UITableView avec des en-têtes et des pieds de page, l'ensemble TableView a des UIScrollView horizontales à l'intérieur. Je l'utilise comme une fonction de verrouillage des titres, comme dans Excel.Pousser un bouton dans un Scrollview sans UserInteraction sur
La fonction UserInteraction est désactivée sur UIScrollView dans l'en-tête UITableview et le pied de page UITableView et ne défile que lorsque le corps défile.
Dans mon en-tête j'ai maintenant un bouton qui est situé dans le UIScrollViews ContentView et je dois être capable d'interagir avec elle, ce qui ne ... Quelqu'un at-il déjà rencontré cela dans le passé?
Une grande partie du code a été omis inutile ...
- (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;
}
merci ... cela fonctionne bien – Burnie777