je suis en utilisant le code ci-dessous pour le défilement automatique uitableviewdéfilement automatique UITableView problème
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [DataArray count];
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath*)indexPath
{
return 60;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *identifier = @"CustomTableCell";
CustomTableCell *cell = (CustomTableCell *)[tableView dequeueReusableCellWithIdentifier:identifier];
if (cell == nil)
{
cell = [[[CustomTableCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier] autorelease];
}
if(isAutoScrollEnabled)
[DataTable scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:YES];
cell.Time.text = [[DataArray objectAtIndex:indexPath.row]objectForKey:@"CurrentTime"];
cell.SerialNo.text = [NSString stringWithFormat:@"%d",indexPath.row+1];
return cell;
}
Mais il fluctates mon tableview chaque fois que je Rechargement des données dans tableview. Y-a-t'il une solution ?
Quelqu'un peut-il m'aider?
Merci à l'avance ......
Pouvez-vous poster du code sur le défilement régulier. – dragon
désolé, j'ai eu un gros travail donc je ne pouvais pas faire de code. Mais, je l'explique ... Utilisez NSTimer avec un intervalle intervalle. Lors d'un événement temporel (sélecteur) U pouvait faire défiler votre vue avec (scrollRectToVisible: animé :) sur UIScrollView ou (scrollToRowAtIndexPath: atScrollPosition: animé :) sur UITableView. Bonne chance. – TopChul