2013-04-12 3 views
0

내부 jQuery과 나는 사용자 정의 셀을 가지고 있고, 그 셀에 하위 뷰로의 ViewController를 추가스크롤은 tableViewCell

TestViewController *vc = [[TestViewController alloc] initWithNibName:@"TestViewController" bundle:nil]; 
[self addSubview:vc.view]; 

새의 ViewController가에있는 tableView 있습니다. 그 tableView를 스크롤하려고하면 사용자 정의 셀이있는 기본 tableView가 스크롤됩니다.

어떻게 해결할 수 있습니까? 사전에

감사

+0

'xcode IDE'또는 'C'와 어떤 관련이 있습니까? – Popeye

+2

나는 그것을 할 수 있는지 잘 모르겠지만 좋은 사용자 경험이 될 것이라고는 생각하지 않는다.하지만 셀에있는'UITableView'에 대한'delegate'을 설정했다고해야할까요? – Popeye

답변

3
나는 당신이 정말로 그것을 그런 식으로 수행하려는 경우 그러나 tableviews을 내장에 대해 조언을 할

이 솔루션은 아마 기본 tableViewhitTest 메소드를 구현하는 것입니다 :

-(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { 

    //here you will need to check if the point lies within any of the 
    //child tableviews and return it .. else return the super method 

    if ([self pointInChildTable:point]) { 
     return [self childTableForPoint:point]; 
    } 
    return [super hitTest:point withEvent:event]; 
} 

pointInChildTablechildTableForPoint은 결과가있는 사전을 반환하는 동일한 메서드 여야합니다. 나는 설명을 위해서 그들을 분리했다.

희망이 도움이됩니다.

+0

'UITableView'를 삽입하는 것은 좋은 생각이 아니라 'hitTest : withEvent :'so + 1 아이디어와 같습니다. – Popeye