开发者

UITableView Scroll slowly

i got the problem in my apps, i have UITableView and it's scroll slowly, not as fast as the other application, even i didn't create any object or add subview in my table

this is my code :

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {  
static NSString *searchingIdentifier = @"searchingIdentifierCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:searchingIdentifier];  
if (cell == nil) {  
        cell = [[[UITableViewCell alloc]   initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:searchingIdentifier]autorelease];  
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
 开发者_Go百科   }  
cell.detailTextLabel.text =[[self.dataStoreByCategory objectAtIndex:indexPath.row]objectForKey:@"storeLevel"];

    cell.textLabel.text = [listStore objectAtIndex:indexPath.row];  
    cell.imageView.image = [[self.dataStoreByCategory   objectAtIndex:indexPath.row] objectForKey:@"storeIcon"];
}

somebody can help me.??


This mainly happens when the contents you are using in the cell is of large size.

In your case, the images you are using in the cells might be of very large size. You can check it by commenting the code and testing it.

To sort out the problem, make an array of thumb nail images to be displayed on the cell instead of the original images. You could find some methods to make the thumb nail of an image by reducing the height and width of image.

If you use the thumb nail images inside the tableview, your table would scroll faster. When the user select any table row, you can display the full image in your next view as required in your application.


Is your image that you put into UITableViewCell is big?

I think you can try to comment the line loading the image to see if it is faster. I don't see any problems in your code


What is the size of your images ? In the same idea, what is the length of the text used ?

If your images are too big, it may slow down the scroll. The same for the text (but it needs a lot of text ^^)


Just try restart your device. Sometimes device tend to go slow if it is "on" for many days! Believe me!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜