このようなフローを作成またはカバーしたいので、UIScrollView
icaraousal などのカバーフローをいくつか試しましたが、このような感じを生成しないので、このタイプのカバーについて知っている人がいたら教えてください。
iCarousal と iCarousal はこのタイプのビューを作成します 側面の画像の位置と角度の違いを確認します
このようなフローを作成またはカバーしたいので、UIScrollView
icaraousal などのカバーフローをいくつか試しましたが、このような感じを生成しないので、このタイプのカバーについて知っている人がいたら教えてください。
iCarousal と iCarousal はこのタイプのビューを作成します 側面の画像の位置と角度の違いを確認します
あなたが求めていることを正確に実行するこの素晴らしいライブラリを探しているかもしれません
ただし、必要な方法を実現するには、内部で編集を行う必要があります
探しているものを達成するために使用できるデリゲートの大規模なコレクションがあります
@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;
まずここに最高の ソースコード
contentOffset
そこにそれらの数字を設定しているものは何でも、あなたがその手の下に設定することにあまり感銘を受けていない可能性があります. そのため、次の瞬間に contentOffset であると思われるものを設定し続けます - その間に contentOffset が変更されたかどうかを確認することはありません。
サブクラスUIScrollView
化してメソッドに魔法を入れsetContentOffset
ます。私の経験では、コンテンツ オフセットの変更はすべて、内部スクロールによって引き起こされるコンテンツ オフセットの変更であっても、そのメソッドを通過します。setContentOffset
ある時点で[super :..] を実行して、メッセージを real に渡しますUIScrollView
。
シフト操作をそこに入れると、よりうまく機能するかもしれません。少なくとも の 3000 オフ設定を検出しcontentOffset
、メッセージを渡す前に修正できます。contentOffset メソッドもオーバーライドする場合は、仮想の無限のコンテンツ サイズを作成できるかどうかを試してみて、それを「フードの下で」実際の比率に減らすことができます。