I am using iCarousel library for iPhone using iCarouselTypeCoverFlow2. I would like to be able to do the following:

  • Get the current item view or image
  • Resize this only item (if possible animating it) from the outside
有帮助吗?

解决方案

In iCarousel you can get the currentItemView. It is in the github documentation.

@property (nonatomic, strong, readonly) UIView *currentItemView;

The currently centered item view in the carousel. The index of this view matches currentItemIndex.

Now that you get the view, you just need to do what you want. But be careful because if you can the view of the item, it will be resized even if you change the item, so take care to adjust it if you want that the item stay equals to the others when it is part of the back items of the coverflow.

Also a important note is that the view are reusable, that implies that when your item is out of the screen other item will use this view, and in some cases the same item that you changed the view will come back in another view.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top