首页 > 其他 > 详细

表格默认选择某行

时间:2016-12-09 11:42:30      阅读:129      评论:0      收藏:0      [点我收藏+]
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    ProductTypeCell *mProductTypeCell = [tableView dequeueReusableCellWithIdentifier:productTypeindterfier];
    mProductTypeCell.selectedBackgroundView = [[UIView alloc] initWithFrame:mProductTypeCell.frame];
    mProductTypeCell.selectedBackgroundView.backgroundColor  = [UIColor whiteColor];
//    另外修改字体的颜色
    mProductTypeCell.typeLable.highlightedTextColor = RGB(0x00bdbe);
    ProductListModel *mProductListModel = _dataArray[indexPath.row];
    mProductTypeCell.typeLable.text = [NSString stringWithFormat:@"%@",mProductListModel.productTypeName];
//默认中    
[_productTableView selectRowAtIndexPath:[NSIndexPath indexPathForItem:
0 inSection:0] animated:YES scrollPosition:UITableViewScrollPositionTop]; if ([_productTableView.delegate respondsToSelector:@selector(tableView:didSelectRowAtIndexPath:)]) {
[_productTableView.
delegate tableView:_productTableView didSelectRowAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:0]]; } return mProductTypeCell; }

 

表格默认选择某行

原文:http://www.cnblogs.com/wq-gril/p/6148619.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!