DJBannerView 1.1.0

DJBannerView 1.1.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release May 2017

Maintained by DennisDeng.


Downloads

Total2
Week0
Month2

Installs

Apps1
powered by Segment

GitHub

Stars3
Watchers2
Forks2
Issues0
Contributors1
Pull Requests0

Code

Files7
LOCLines of Code 1,323


  • By
  • Dennis Deng

A ViewPager that can scroll automatically.

Screenshots

image

Requirements

  • iOS 7.0 or later
  • Xcode 7.3 or later

Installation

  1. Podfile 中添加 pod 'DJBannerView'
pod 'DJBannerView'
  1. 执行 pod installpod update
$ pod install
  1. 导入 <DJBannerView/DJBannerView.h>
#import <DJBannerView/DJBannerView.h>
#import <DJBannerView/DJPageBannerView.h>
#import <DJBannerView/DJManualBannerView.h>

Licenses

All source code is licensed under the MIT License.

Architecture

BannerView

  • DJBannerView
  • DJPageBannerView
  • DJManualBannerView

BannerViewScrollDirection

  • BannerViewScrollDirectionLandscape /** 水平滚动 **/
  • BannerViewScrollDirectionPortait /** 垂直滚动 **/

BannerViewPageStyle

  • BannerViewPageStyle_None /** 不显示 **/
  • BannerViewPageStyle_Left /** 居左 **/
  • BannerViewPageStyle_Middle /** 居中 **/
  • BannerViewPageStyle_Right /** 居右 **/

Usage

DJBannerView

self.bannerView = [[DJBannerView alloc] initWithFrame:CGRectMake(0, 50.0f, UI_SCREEN_WIDTH, UI_SCREEN_WIDTH*140/320) scrollDirection:BannerViewScrollDirectionPortait images:dataArray];

[self.bannerView setRollingDelayTime:4.0f];
[self.bannerView setDelegate:self];
[self.bannerView setPageControlStyle:BannerViewPageStyle_Right];
[self.view addSubview:self.bannerView];

[self.bannerView startRolling];

DJPageBannerView

DJPageBannerView *pageBannerView = [[DJPageBannerView alloc] initWithFrame:CGRectMake(0, bannerView.frame.origin.y+bannerView.frame.size.height+20.0f, UI_SCREEN_WIDTH, (UI_SCREEN_WIDTH-80.0f)*140/320) scrollDirection:BannerViewScrollDirectionLandscape images:dataArray pageWidth:UI_SCREEN_WIDTH-80.0f padding:10.0f];
[pageBannerView setDelegate:self];
[pageBannerView setPageControlStyle:BannerViewPageStyle_Middle];
pageBannerView.showClose = NO;
[pageBannerView setCorner:8.0f];
[self.view addSubview:pageBannerView];

DJManualBannerView

self.manualBannerView = [[DJManualBannerView alloc] initWithFrame:CGRectMake(0.0f, pageBannerView.frame.origin.y+pageBannerView.frame.size.height+20.0f, UI_SCREEN_WIDTH, Image_Height) scrollDirection:BannerViewScrollDirectionLandscape images:nil padding:20.0f pageWidth:Image_Width dataSource:self];
self.manualBannerView.hasLeftPadding = YES;
[self.manualBannerView setPageControlStyle:BannerViewPageStyle_None];
[self.manualBannerView reloadBannerWithData:nil];
[self.manualBannerView setCorner:6.0f];
[self.view addSubview:self.manualBannerView];

Author