//默认选中第一行,并执行点击事件
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
[mytableview selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:YES scrollPosition:UITableViewScrollPositionTop];
if ([mytableview.delegate respondsToSelector:@selector(tableView:didSelectRowAtIndexPath:)]) {
[mytableview.delegate tableView:mytableview didSelectRowAtIndexPath:indexPath];
}
tableview默认选中第一行
最新推荐文章于 2024-07-02 19:18:39 发布