在UITableview中放置的UICollectionView,然后设置滚动没有效果scrollToItemAtIndexPath
- (void)layoutSubviews
{
[self.collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:self.selectedIdx inSection:0] atScrollPosition:UICollectionViewScrollPositionNone animated:YES];
}
- (void)setSelectedIdx:(NSInteger)selectedIdx
{
_selectedIdx = selectedIdx;
// 显示到当前的位置
}
本文探讨了在UITableview中嵌套使用UICollectionView时,如何通过scrollToItemAtIndexPath方法使UICollectionView滚动到指定的IndexPath位置,但遇到了该方法似乎无效的问题。
23万+

被折叠的 条评论
为什么被折叠?



