UITable View Не перезагружать - PullRequest
       2

UITable View Не перезагружать

0 голосов
/ 05 сентября 2011

Я использую следующий код в табличном представлении для отображения последней строки. Но здесь проблема в том, что при использовании этого я не могу прокрутить таблицу.Я ищу много для этого, но я не нашел способ решить этот вопрос.Может кто-нибудь дать какое-нибудь предложение, как решить эту проблему.

- (UITableViewCell *)tableView:(UITableView *)tableView1 cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static NSString *MyIdentifier = @"MyIdentifier";

// here to draw cell ImageCell is used for customise cell.

ImageCell *cell = (ImageCell *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier]; // changed this

if (cell == nil) {
    cell = [[[ImageCell alloc] initWithFrame:CGRectZero reuseIdentifier:MyIdentifier] autorelease]; // changed this

}
cell.selectionStyle=UITableViewCellSelectionStyleNone;
// setting the text

NSDictionary *messageData = [messageArray objectAtIndex:[indexPath row]];
[cell setData:messageData];

int lastRowNumber = [tableView numberOfRowsInSection:0]-1;
NSIndexPath* ip = [NSIndexPath indexPathForRow:lastRowNumber inSection:0];
[tableView scrollToRowAtIndexPath:ip atScrollPosition:UITableViewScrollPositionNone animated:YES];
// Set up the cell
return cell;
}

Это мой код.

1 Ответ

0 голосов
/ 05 сентября 2011

atScrollPosition:UITableViewScrollPositionNone ваш виновник, используйте UITableViewScrollPositionBottom или UITableViewScrollPositionTop

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...