- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
// 自定义cell点击背景
cell.selectedBackgroundView =
[[UIViewalloc] initWithFrame:cell.frame];
cell.selectedBackgroundView.backgroundColor = RGBCOLOR(194, 194, 194);
// 默认选中第一行 只执行一次(否则有BUG)
if (!isRuned) {
NSIndexPath *firstPath = [NSIndexPathindexPathForRow:0inSection:0];
[m_tableViewselectRowAtIndexPath:firstPath animated:YESscrollPosition:UITableViewScrollPositionTop];
isRuned = YES;
}
时间: 2024-08-03 01:18:30