zoukankan      html  css  js  c++  java
  • 关于 cellForRor中给cell setSelected的时机问题?

    我在  cell  里边  

    - (void)setSelected:(BOOL)selected animated:(BOOL)animated {

        [super setSelected:selected animated:animated];

        self.nameLabel.highlighted = selected;

        

        self.leftImageView.highlighted = selected;

        

        self.backImageView.highlighted = selected;

        

        // Configure the view for the selected state

    }

     在外边  调用的时候  if(indexPath.row == 0){

    [cell setSelected :yes animation:no];

    }不调用的 问题  

    解决办法  两个方法

    1.。。//        if(indexPath.row == 0){

    //        

    //            [self.categoryTableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:UITableViewScrollPositionNone];

    //            

    //        }

     2。。。

    -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{

       

        

            if(indexPath.row == 0){

            

                [cell setSelected:YES animated:NO];

         }

    }

  • 相关阅读:
    贝叶斯网路的采样
    马尔可夫蒙特卡洛采样法
    高斯分布的采样
    常见的采样方法
    正则化
    随机梯度下降
    机器学习中的优化问题
    【原】涉及数据库的单元测试-JTeser
    高度和宽度
    定位position
  • 原文地址:https://www.cnblogs.com/yecong/p/6207564.html
Copyright © 2011-2022 走看看