Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ABTableViewCell selected lag

Tags:

uitableview

I've successfuly subclassed ABTableViewCell for fast scrolling. I really recommend it to anyone who's making an app with big tableViews...

http://blog.atebits.com/2008/12/fast-scrolling-in-tweetie-with-uitableview/

My problem with it is that when I tap a row, there is a small delay until it gets selected. I tried to put [cell setSelected:true] in the didSelectRowAtIndexPath method of the tableView, and it still lags. Has anyone experienced this as well with a ABTableViewCell subclass?

I didn't have this issue using regular UITableViewCells.

like image 886
samvermette Avatar asked Jan 28 '26 14:01

samvermette


1 Answers

A cell can be highlighted (on touchDown) or selected (on touchUp).

Code that came with ABTableViewCell:

if(self.selected) {
    backgroundColor = [UIColor clearColor];
    greyColor = [UIColor whiteColor];
    blackColor = [UIColor whiteColor];
}

Had to replace it with:

if(self.highlighted || self.selected) {
    backgroundColor = [UIColor clearColor];
    greyColor = [UIColor whiteColor];
    blackColor = [UIColor whiteColor];
}

And that killed the cell selection lag.

like image 164
samvermette Avatar answered Jan 31 '26 21:01

samvermette



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!