SORU
19 EKİM 2009, PAZARTESİ


Tespit UİTableView kaydırma

Ben zaten alt UİTableView (KRTableView) ve uygulanan dört dokunmatik tabanlı yöntemler (touchesBegan, touchesEnded, touchesMoved ve touchesCancelled) böylece ben algılayan bir dokunmatik tabanlı bir olay olarak ele bir UİTableView. Algılamak lazım aslında UİTableView yukarı veya aşağı kaydırma.

Ancak, UİTableView sınıflara ve yukarıdaki yöntemleri oluşturma sadece kaydırma veya parmak hareketi tüm UİTableView bir UİTableViewCell içinde oluşan algılar.

Parmağımı bir sonraki hücre üzerine taşındı olarak, dokunma olaylar bir şey yapma.

Bu UİTableView sınıflara gösterdim:

#import "KRTableView.h"


@implementation KRTableView

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    [super touchesBegan:touches withEvent:event];	
    NSLog(@"touches began...");
}

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
    [super touchesMoved:touches withEvent:event];
  NSLog(@"touchesMoved occured");   
}

- (void)touchesCancelled:(NSSet*)touches withEvent:(UIEvent *)event {
    [super touchesCancelled:touches withEvent:event];
  NSLog(@"touchesCancelled occured");   
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
  [super touchesEnded:touches withEvent:event];
  NSLog(@"A tap was detected on KRTableView");
}

@end

Nasıl UİTableView yukarı veya aşağı kaydırma zaman algılayabilir miyim?

CEVAP
19 EKİM 2009, PAZARTESİ


Olay yöntemleri yakalamak gerek yok. UIScrollViewDelegate protokolü için belgeleri kontrol edin ve -scrollViewDidScroll: -scrollViewWillBeginDragging: yöntemlerden durumunuza bağlı olarak uygulamak.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • adrianisen

    adrianisen

    25 Kasım 2009
  • backyardjay

    backyardjay

    8 ŞUBAT 2009
  • bunnyboxx

    bunnyboxx

    17 NİSAN 2008