All Projects → guowilling → SRCarouselView

guowilling / SRCarouselView

Licence: MIT license
A carousel view that only uses two UIImageView to achieve infinite carousel.

Programming Languages

objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to SRCarouselView

Cwcarousel
轮播图banner
Stars: ✭ 228 (+307.14%)
Mutual labels:  carousel, banner
Newpagedflowview
电影票卡片式无限自动轮播图
Stars: ✭ 819 (+1362.5%)
Mutual labels:  carousel, banner
Ngu Carousel
Angular Universal carousel
Stars: ✭ 263 (+369.64%)
Mutual labels:  carousel, banner
Pagerecyclerview
PageRecyclerView achieves page turning function and unlimited carousel
Stars: ✭ 241 (+330.36%)
Mutual labels:  carousel, banner
svelte-slidy
📸 Sliding action script
Stars: ✭ 211 (+276.79%)
Mutual labels:  carousel
campaign-manager
The Camapign Management UI for RTB4Free, the open source bidder / DSP.
Stars: ✭ 24 (-57.14%)
Mutual labels:  banner
vue-m-carousel
vue 移动端轮播组件
Stars: ✭ 53 (-5.36%)
Mutual labels:  carousel
SimpleSlider
Simple responsive slider created in pure javascript.
Stars: ✭ 21 (-62.5%)
Mutual labels:  carousel
skeleton-carousel
Carousel component. Horizontal and vertical swipe navigation
Stars: ✭ 31 (-44.64%)
Mutual labels:  carousel
vue-carousel
Infinite image carousel built with Vue.js
Stars: ✭ 43 (-23.21%)
Mutual labels:  carousel
AndroidSliderViewsLibrary
AndroidSliderViewsLibrary is an Android SDK library supports vertical & horizontal carousel and slideshow Views which developers simply integrate on Android project. - by @sung2063
Stars: ✭ 33 (-41.07%)
Mutual labels:  carousel
react-banner
A dynamic banner/header component.
Stars: ✭ 25 (-55.36%)
Mutual labels:  banner
react-native-carousel-component
React Native Carousel Component for IOS & Android
Stars: ✭ 61 (+8.93%)
Mutual labels:  carousel
stimulus-carousel
A Stimulus controller to deal with carousel.
Stars: ✭ 22 (-60.71%)
Mutual labels:  carousel
ngx-slick-carousel
Angular 11+ wrapper for slick plugin
Stars: ✭ 82 (+46.43%)
Mutual labels:  carousel
v-owl-carousel
🦉 VueJS wrapper for Owl Carousel
Stars: ✭ 46 (-17.86%)
Mutual labels:  carousel
pinar
🌲☀️ Customizable, lightweight React Native carousel component with accessibility support.
Stars: ✭ 214 (+282.14%)
Mutual labels:  carousel
react-cool-virtual
😎 ♻️ A tiny React hook for rendering large datasets like a breeze.
Stars: ✭ 1,031 (+1741.07%)
Mutual labels:  carousel
react-native-viewpager-carousel
a flexible viewpager library with carousel functionality
Stars: ✭ 39 (-30.36%)
Mutual labels:  carousel
react-imageViewer
React component for image displaying in full screen
Stars: ✭ 61 (+8.93%)
Mutual labels:  carousel

SRCarouselView

A carousel view that only uses two UIImageView to achieve infinite carousel.

image

Features

  • Creates with an array that can contain local image, network image or both of them.
  • Not rely on any third-party libraries, use the native api to download and cache image.
  • UIPageControl will be displayed on the right If there are descriptions, otherwise displayed on the center.

APIs

+ (instancetype)sr_carouselViewWithImageArrary:(NSArray *)imageArrary;

+ (instancetype)sr_carouselViewWithImageArrary:(NSArray *)imageArrary describeArray:(NSArray *)describeArray;

+ (instancetype)sr_carouselViewWithImageArrary:(NSArray *)imageArrary describeArray:(NSArray *)describeArray placeholderImage:(UIImage *)placeholderImage;

/**
 Creates and returns a infinite carousel view with imageArrary, describeArray, placeholderImage and delegate.
 
 @param imageArrary      An array contains local images, or urls of images, or mixed of them.
 @param describeArray    An array contains image describes which in the same order as the images.
 @param placeholderImage The placeholder image when network image have not downloaded.
 @param delegate         The receiver’s delegate object.
 @return A newly carousel view.
 */
+ (instancetype)sr_carouselViewWithImageArrary:(NSArray *)imageArrary describeArray:(NSArray *)describeArray placeholderImage:(UIImage *)placeholderImage delegate:(id<SRCarouselViewDelegate>)delegate;

/**
 Creates and returns a infinite carousel view with imageArrary, describeArray, placeholderImage and block.

 @param imageArrary      An array contains local images, or urls of images, or mixed of them.
 @param describeArray    An array contains image describes which in the same order as the images.
 @param placeholderImage The placeholder image when network image have not downloaded.
 @param block            A block object to be executed when tap the carousel view.
 @return A newly carousel view.
 */
+ (instancetype)sr_carouselViewWithImageArrary:(NSArray *)imageArrary describeArray:(NSArray *)describeArray placeholderImage:(UIImage *)placeholderImage block:(DidTapCarouselViewAtIndexBlock)block;

Usage

// local images
NSArray *imageArray = @[[UIImage imageNamed:@"logo01.jpg"],
                        [UIImage imageNamed:@"logo02.jpg"],
                        [UIImage imageNamed:@"logo03.jpg"],
                        [UIImage imageNamed:@"logo04.jpg"],
                        [UIImage imageNamed:@"logo05.jpg"]];
NSMutableArray *describeArray = [[NSMutableArray alloc] init];
for (NSInteger i = 0; i < imageArray.count; i++) {
    NSString *tempDesc = [NSString stringWithFormat:@"Image Description %zd", i + 1];
    [describeArray addObject:tempDesc];
}
SRCarouselView *carouselView = [SRCarouselView sr_carouselViewWithImageArrary:imageArray describeArray:nil placeholderImage:nil delegate:self];
carouselView.frame = CGRectMake(0, 44, self.view.frame.size.width, 200);
carouselView.autoPagingInterval = 10.0;
[self.view addSubview:carouselView];
// network images
NSArray *imageArray = @[@"https://yixunfiles-ali.yixun.arhieason.com/9535a537ad2538d53ec1a351deff3856_jpg.jpg?x-oss-process=image/format,png",
                        @"https://yixunfiles-ali.yixun.arhieason.com/8f8b02a025a7b62e81cafc4e9d89f70e_jpg.jpg?x-oss-process=image/format,png",
                        @"https://yixunfiles-ali.yixun.arhieason.com/6c72618dc3412974369d544a2734d5cb_jpg.jpg?x-oss-process=image/format,png",
                        @"https://yixunfiles-ali.yixun.arhieason.com/63a0bb8cd057e12c45ecbcb7f24e4ecf_jpg.jpg?x-oss-process=image/format,png",
                        @"https://yixunfiles-ali.yixun.arhieason.com/2393d812560715fb9a38df9550b1f749_jpg.jpg?x-oss-process=image/format,png"];
NSMutableArray *describeArray = [[NSMutableArray alloc] init];
for (NSInteger i = 0; i < imageArray.count; i++) {
    NSString *tempDesc = [NSString stringWithFormat:@"Image Description %zd", i];
    [describeArray addObject:tempDesc];
}
SRCarouselView *carouselView = [SRCarouselView sr_carouselViewWithImageArrary:imageArray describeArray:nil placeholderImage:[UIImage imageNamed:@"placeholder_image.jpg"] block:^(NSInteger index) {
    NSLog(@"index: %zd", index);
}];
carouselView.frame = CGRectMake(0, 245, self.view.frame.size.width, 200);
[self.view addSubview:carouselView];
// local and network Images
NSArray *imageArray = @[@"https://yixunfiles-ali.yixun.arhieason.com/9535a537ad2538d53ec1a351deff3856_jpg.jpg?x-oss-process=image/format,png",
                        @"https://yixunfiles-ali.yixun.arhieason.com/8f8b02a025a7b62e81cafc4e9d89f70e_jpg.jpg?x-oss-process=image/format,png",
                        [UIImage imageNamed:@"logo03.jpg"],
                        [UIImage imageNamed:@"logo04.jpg"],
                        [UIImage imageNamed:@"logo05.jpg"]];
NSMutableArray *describeArray = [[NSMutableArray alloc] init];
for (NSInteger i = 0; i < imageArray.count; i++) {
    NSString *tempDesc = [NSString stringWithFormat:@"Image Description"];
    [describeArray addObject:tempDesc];
}
SRCarouselView *carouselView = [SRCarouselView sr_carouselViewWithImageArrary:imageArray describeArray:describeArray placeholderImage:[UIImage imageNamed:@"placeholder"] delegate:self];
carouselView.frame = CGRectMake(0, 446, self.view.frame.size.width, 200);
carouselView.autoPagingInterval = 10.0;
[self.view addSubview:carouselView];

Custom

/**
 The time interval of auto paging, default is 5.0s.
 */
@property (nonatomic, assign) NSTimeInterval autoPagingInterval;

@property (nonatomic, strong) UIColor *currentPageIndicatorTintColor;
@property (nonatomic, strong) UIColor *pageIndicatorTintColor;

@property (nonatomic, strong) UIImage *currentPageIndicatorImage;
@property (nonatomic, strong) UIImage *pageIndicatorImage;
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].