문제

탭할 수있는 여러 영역이있는 사용자 정의 UitableViewCell을 만들도록 요청 받았습니다.

이 영역에는 버튼이나 그래픽이 없습니다. 보이지 않습니다. 3 셀의 세 번째 셀에 따라 3 가지 다른 방법이 IE를 활용합니다.

|| DECREMENTFOOCOUNT || ViewFoodEtails || ycrementfoococount ||

셀에는 몇 가지 라벨이있어 항상 볼 수 있어야합니다.

나는 아마도 세포에 숨겨진 세 개의 uibittons를 생각하고 있습니까?

또한 기본 동작을 삭제하려면 스 와이프를 유지해야합니다.

도움이 되었습니까?

해결책

UitableViewCell을 서브 클래스하고 재정의 할 수 있습니다 touchesBegan:withEvent: 방법. 그런 다음 터치가 배치 된 위치의 CGPoint를 얻을 수 있습니다.

- (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event {
   UITouch* touch = touches.anyObject;
   CGPoint location = [touch locationInView:self];

   if (CGRectContainsPoint(myTestRect, location)) {
       // Touched inside myTestRect, do whatever...
   } else {
      // Let the default implementation take over.
      [super touchesBegan:touches withEvent:event];
   }
}

앤드류

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top