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
Olay yöntemleri yakalamak gerek yok. UIScrollViewDelegate
protokolü için belgeleri kontrol edin ve -scrollViewDidScroll:
-scrollViewWillBeginDragging:
yöntemlerden durumunuza bağlı olarak uygulamak.
Zaman uyumsuz görüntü kaydırma yaparke...
Metin alanı seçildiğinde UİTableView b...
Nasıl sayfa jQuery kullanarak kaydırma...
Kaydırma UİTableView zaman klavye gizl...
Android: ScrollView durur kaydırma sır...