2013-08-22 2 views
0

Я попытался загрузить динамические изображения в виде изображения и текст в ярлыке, работая как на симуляторе, так и на устройстве ios. (Смотри ниже код)Пользовательский UITableView с UITextview не плавно прокручивается в устройстве ios.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
     { 
      ImageCell *cell = (ImageCell *)[self.TestTable dequeueReusableCellWithIdentifier:@"ImageCell"]; 
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) 
    { 
     if (cell == nil) { 
      NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"ImageCell" owner:self options:nil]; 
      cell = [topLevelObjects objectAtIndex:0]; 
     } 
    } 
    else 
    { 
     if (cell == nil) 
     { 

      NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"ImageCell" owner:self options:nil]; 
      cell = [topLevelObjects objectAtIndex:0]; 
     } 
    } 

[email protected]"Cable and Hose Carriers"; 

cell.ProductsImages.image = [UIImage imageNamed:@"cool.jpg"]; 



return cell; 
} 

Но если я пытался загрузить данные в UITextView в пользовательских Tableview клеток, TableView не прокручивать плавно (заикание) в ИО устройстве, но отлично работает в simulator.Please посоветуете мне делать это лучше.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
     { 
      ImageCell *cell = (ImageCell *)[self.TestTable dequeueReusableCellWithIdentifier:@"ImageCell"]; 
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) 
    { 
     if (cell == nil) { 
      NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"ImageCell" owner:self options:nil]; 
      cell = [topLevelObjects objectAtIndex:0]; 
     } 
    } 
    else 
    { 
     if (cell == nil) 
     { 

      NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"ImageCell" owner:self options:nil]; 
      cell = [topLevelObjects objectAtIndex:0]; 
     } 
    } 
cell.ProductsDetailsTextView.delegate = self; 
cell.ProductsDetailsTextView.text=[Descriptions objectAtIndex:indexpath.row]; 

return cell; 
} 

ответ

3

Вы пытаетесь сделать все на главной теме. Ваш основной поток начинает блокироваться из-за динамической загрузки данных, поэтому tableview не плавно прокручивается. Попробуйте написать код в другой очереди

Thats It.

+0

Я попробовал, но снова его свободный плавный, его происходит только для UITextview – Dsk

Смежные вопросы