iCarousel 第一个item的位置总是在中间位置?我想让他靠左边

图片描述

- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSInteger)index reusingView:(UIView *)view {
    
    if (!view) {
        view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 110, 110)];
    }
    view.backgroundColor = self.recommendDataArray[index];
    return view;
}
阅读 3.8k
1 个回答

iCarousel 有一个方法可以滚动到指定的 item 位置,视图加载完直接调用滚动到第2个或者第3个 item,第一个 item 的位置就靠左边了。

- (void)scrollToItemAtIndex:(NSInteger)index animated:(BOOL)animated;
推荐问题