Git Product home page Git Product logo

lcbannerview's Introduction

LCBannerView

πŸ”₯A very popular and highly customized banner view! And, infinite loop!

LCBannerView

In me the tiger sniffs the rose.

εΏƒζœ‰ηŒ›θ™ŽοΌŒη»†ε—…θ”·θ–‡γ€‚

中文介绍

Introduction

This is a display of advertising or information.

You can using the images from local or internet.

And it won't affect other scrollViews' scrollsToTop propertie.

If you feel good, please give me a star, thank you very much! ⭐️

Installation

LCBannerView is available on CocoaPods. Just add the following to your project Podfile:

pod "LCBannerView"  # Podfile

Non-CocoaPods Installation

Just drag the LCBannerView folder into your project.

Usage

  • Use by including the following import:
#import "LCBannerView.h"
  • Demo code:
// 1. from internet
[scrollView addSubview:({
    
    LCBannerView *bannerView = [LCBannerView bannerViewWithFrame:CGRectMake(0, 300.0f, [UIScreen mainScreen].bounds.size.width, 200.0f)
                                                        delegate:self
                                                       imageURLs:URLs
                                                placeholderImage:nil
                                                   timerInterval:2.0f
                                   currentPageIndicatorTintColor:[UIColor redColor]
                                          pageIndicatorTintColor:[UIColor whiteColor]];
    bannerView;
})];

// 2. from local
/*  
 *  If you using images from local, you should let images named: `[email protected]`, `[email protected]`...
 *  Than, you just give me a image named: `banner`. 😜
 */
[scrollView addSubview:({
    
    LCBannerView *bannerView = [[LCBannerView alloc] initWithFrame:CGRectMake(0, 20.0f, [UIScreen mainScreen].bounds.size.width, 200.0f)
                                                          delegate:self
                                                         imageName:@"banner"
                                                             count:3
                                                     timerInterval:3.0f
                                     currentPageIndicatorTintColor:[UIColor orangeColor]
                                            pageIndicatorTintColor:[UIColor whiteColor]];
    bannerView;
})];
  • Delegate (@optional):
- (void)bannerView:(LCBannerView *)bannerView didClickedImageIndex:(NSInteger)index;
  • For example:
- (void)bannerView:(LCBannerView *)bannerView didClickedImageIndex:(NSInteger)index {
      
      NSLog(@"you clicked image in %@ at index: %ld", bannerView, (long)index);
}

// logs
2015-11-30 17:36:20.611 LCBannerViewDemo[6075:456257] you clicked image in <LCBannerView: 0x7fc98b751ff0; frame = (0 300; 375 200); layer = <CALayer: 0x7fc98b7521b0>> at index: 1
2015-11-30 17:36:21.292 LCBannerViewDemo[6075:456257] you clicked image in <LCBannerView: 0x7fc98b433190; frame = (0 20; 375 200); layer = <CALayer: 0x7fc98b42ce20>> at index: 1
2015-11-30 17:36:21.801 LCBannerViewDemo[6075:456257] you clicked image in <LCBannerView: 0x7fc98b751ff0; frame = (0 300; 375 200); layer = <CALayer: 0x7fc98b7521b0>> at index: 2
  • Custom parameters (in LCBannerView.m):
// pageControl to the bottom of the distance
static CGFloat LCPageDistance = 10.0f;

Thanks

Support

License

MIT License

lcbannerview's People

Contributors

itofu avatar

Watchers

@FelixMLians avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.