开发者

How to add action for UITableView index event - for each alphabet letter

I have alphabet strip (index), like in Apple's Contacts app, showing in a UITableView but now I want to add an act开发者_JAVA技巧ion for each and every letter when I touch them?


Take a look at UITableViewDataSource protocol.

You'll easily know which letter was touched.


Take advantage of the fact that the tableView is a scrollView and that your <UITableViewDelegate> will also conform to <UIScrollViewDelegate> and use the -scrollViewDidScroll: method:

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
    if(![scrollView isDragging] && ![scrollView isDecelerating]) {
        NSLog(@"User scrolled using tableView index");
    }
}

Best,

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜