【发布时间】:2013-07-08 05:14:09
【问题描述】:
嘿,我想制作一个聊天演示。所以当我为它打开 UITableView 时,它应该从最后一项显示,前一项应该在上侧。即,我想将我的 UITableView 自动滚动到最后一行当用户打开聊天屏幕时。我该怎么办?
我的代码是-
cell = [tv dequeueReusableCellWithIdentifier:@"Cell"];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:nil] autorelease];
}
[lblName setFont:[UIFont fontWithName:@"Arial" size:12]];
lblName.lineBreakMode = NSLineBreakByWordWrapping;
lblName.numberOfLines = 0;
lblName.text=[arrUsername objectAtIndex:indexPath.row];
lblName.textColor = [UIColor blackColor];
[lblName setBackgroundColor:[UIColor grayColor]];
if ([[arrCommentUid objectAtIndex:indexPath.row] isEqualToString:@"1"]) {
[lblName setTextAlignment:NSTextAlignmentLeft];
}
else
请帮忙!!它只是 UITableView 的 optional.cell 的代码
【问题讨论】:
标签: iphone uitableview