我想制作UIScrollView
或覆盖这样的流程我尝试了一些像icaraousal等的封面流程,但那些不会产生这样的感觉,所以如果有人知道这种类型的封面,那么请建议我。
和iCarousal创建这种类型的视图,看到侧面图像的位置和角度的差异
答案 0 :(得分:3)
您可能正在寻找符合您要求的awsome library
但你必须在里面进行一些编辑以实现你想要的方式
它有大量的代表,可用于实现您的目标
@protocol iCarouselDataSource <NSObject>
- (NSUInteger)numberOfItemsInCarousel:(iCarousel *)carousel;
- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view;
@optional
- (NSUInteger)numberOfPlaceholdersInCarousel:(iCarousel *)carousel;
- (UIView *)carousel:(iCarousel *)carousel placeholderViewAtIndex:(NSUInteger)index reusingView:(UIView *)view;
- (NSUInteger)numberOfVisibleItemsInCarousel:(iCarousel *)carousel;
//deprecated, use carousel:viewForItemAtIndex:reusingView: and carousel:placeholderViewAtIndex:reusingView: instead
- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index __deprecated;
- (UIView *)carousel:(iCarousel *)carousel placeholderViewAtIndex:(NSUInteger)index __deprecated;
@end
@protocol iCarouselDelegate <NSObject>
@optional
- (void)carouselWillBeginScrollingAnimation:(iCarousel *)carousel;
- (void)carouselDidEndScrollingAnimation:(iCarousel *)carousel;
- (void)carouselDidScroll:(iCarousel *)carousel;
- (void)carouselCurrentItemIndexUpdated:(iCarousel *)carousel;
- (void)carouselWillBeginDragging:(iCarousel *)carousel;
- (void)carouselDidEndDragging:(iCarousel *)carousel willDecelerate:(BOOL)decelerate;
- (void)carouselWillBeginDecelerating:(iCarousel *)carousel;
- (void)carouselDidEndDecelerating:(iCarousel *)carousel;
- (CGFloat)carouselItemWidth:(iCarousel *)carousel;
- (CGFloat)carouselOffsetMultiplier:(iCarousel *)carousel;
- (BOOL)carouselShouldWrap:(iCarousel *)carousel;
- (CGFloat)carousel:(iCarousel *)carousel itemAlphaForOffset:(CGFloat)offset;
- (CATransform3D)carousel:(iCarousel *)carousel itemTransformForOffset:(CGFloat)offset baseTransform:(CATransform3D)transform;
- (CGFloat)carousel:(iCarousel *)carousel valueForTransformOption:(iCarouselTranformOption)option withDefault:(CGFloat)value;
//deprecated, use transformForItemAtIndex:withOffset:baseTransform: instead
- (CATransform3D)carousel:(iCarousel *)carousel transformForItemView:(UIView *)view withOffset:(CGFloat)offset __deprecated;
- (BOOL)carousel:(iCarousel *)carousel shouldSelectItemAtIndex:(NSInteger)index;
- (void)carousel:(iCarousel *)carousel didSelectItemAtIndex:(NSInteger)index;
答案 1 :(得分:1)
首先 Source Code
可能无论在那里设置这些数字的是什么,你设置contentOffset
都不会给你留下太深刻的印象。所以它只是继续设置它认为应该是下一个瞬间的contentOffset - 而不验证contentOffset是否在此期间发生了变化。
我会继承UIScrollView
并将魔法置于setContentOffset
方法中。根据我的经验,所有内容偏移更改都会通过该方法,甚至是内部滚动引起的内容偏移更改。只需要[super setContentOffset
:..]在某个时刻将消息传递给真实的UIScrollView
。
也许如果你把你的换挡动作放在那里它会更好。您至少可以检测到contentOffset
的3000关设置,并在传递消息之前修复它。如果您还要覆盖contentOffset方法,您可以尝试查看是否可以制作虚拟无限内容大小,并将其减少到实际比例&#34;引擎盖下#34;。