2012-02-08 3 views
0

UITableView 행 선택에 문제가 있습니다. 보기로드 (구성에 따라 다름)이 경우 50px로 TableView의 크기를 조정하고이 50 픽셀에서는 선택이 작동하지 않습니다. .Xcode UITableView 크기가 조정될 때 선택이 작동하지 않습니다.

if (Config.alza){ 
    //Se non ho nessuno sconto incremento la dimensione della lista di 50Px necessari per mostrare gli sconti testata 
    CGRect frame = ListaOrdine.frame; 
    frame.size.height += 50; 
    ListaOrdine.frame = frame; 
} 

//Attivo la gestione del click 
TapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(Click:)]; 
[TapGesture setNumberOfTapsRequired:1]; 
[TapGesture setCancelsTouchesInView:NO]; //Serve per non bruciare l'evento click 
[ListaOrdine addGestureRecognizer:TapGesture]; 

누군가가 아이디어가 있습니까?

답변

0

당신은

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ 

    //Your existing code 
    if (Config.alza){ 
     //Se non ho nessuno sconto incremento la dimensione della lista di 50Px necessari per mostrare gli sconti testata 
     return yourDefaultCellHeight + 50; 
    } 

    return yourDefaultCellHeight; 

} 
+0

행의 높이를 올리지 말아야합니다. – Tommaso

0

이 방법을 구현 테이블 뷰 대리자를 사용하여 행의 높이를 지정해야합니다 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

+0

didselectrowatindexpath를 구현했지만 이벤트가 50px에서 발생하지 않습니다. – Tommaso

+0

- (CGFloat) tableView : (UITableView *) tableView heightForRowAtIndexPath :(전체 화면을 사용하고 싶습니다.) NSIndexPath *) indexPath 메서드 ?? –

+0

예 모든 대리자 메서드를 구현했습니다 – Tommaso

0

난 후 크기를 조정 bringtofront에있는 tableview 컨트롤에 의해 해결 한

if (Config.alza){ 
    //Se non ho nessuno sconto incremento la dimensione della lista di 50Px necessari per mostrare gli sconti testata 
    CGRect frame = ListaOrdine.frame; 
    frame.size.height += 50; 
    ListaOrdine.frame = frame; 
    [self.view bringSubviewToFront:ListaOrdine]; 
} 

문제는 새로운 50px의 tableview가 테이블 뷰 대신 이벤트를 발생시키는 다른 뷰로 덮여 있다는 것입니다.

관련 문제