uicollectionview select an item immediately after reloaddata?

前端 未结 9 1164
自闭症患者
自闭症患者 2021-02-13 16:23

After calling -[UICollectionView reloadData] it takes some time for cells to be displayed, so selecting an item immediately after calling reloadData do

9条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-13 16:50

    create a method that does the selection and call it using performSelector after calling reload e.g;

    [self performSelector:@selector(selectIt) withObject:self afterDelay:0.1];
    

提交回复
热议问题