美文网首页极乐科技iOS 控件定制项目源码
[iOS]定制性强的广告轮播图--SCAdView

[iOS]定制性强的广告轮播图--SCAdView

作者: 陈小翰 | 来源:发表于2017-02-08 22:42 被阅读859次

@[无限轮播图] @[3D轮播图] @[广告轮播图]

SCAdView

Statement

If my code can help you even a little bit , please click star . Thanks for your support , your star is my motivation.

Introduction

SCAdView is a carousel control which support the vertical or horizontal scrolling direction, finite / infinite loop carousel , with both 2D plane effect or 3D zoom effect.

Installation

Manual installation

download the code and unzip,then copy SCAdView directory into your project.

CocoaPods

create or modify your podfile:

pod 'SCAdView'

and then pod install

Usage

The SCAdView should be created by a SCAdViewBuilder,we can customize SCAdView by modifying a builder's property.
eg.

    SCAdView *adView = [[SCAdView alloc] initWithBuilder:^(SCAdViewBuilder *builder) {
        builder.adArray = arrayFromService;
        builder.viewFrame = (CGRect){0,100,self.view.bounds.size.width,self.view.bounds.size.width/2.f};
        builder.adItemSize = (CGSize){self.view.bounds.size.width/2.5f,self.view.bounds.size.width/4.f};
        builder.minimumLineSpacing = 0;
        builder.secondaryItemMinAlpha = 0.6;
        builder.threeDimensionalScale = 1.45;
        builder.itemCellNibName = @"SCAdDemoCollectionViewCell";
    }];

About SCAdViewBuilder

Please read SCAdViewBuilder's interface in SCAdView.h file.

Effects

Horizontal scrolling Vertical scrolling

SCAdView

前言

如果我的代码能帮助到你哪怕是一点点,请点一下star。谢谢你的支持,你的star是我的动力。

介绍

SCAdView 是一个支持2D平面效果和3D缩放效果 , 可定制上下左右方向滚动 , 有限/无限循环 轮播的轮播控件

安装

手动安装

下载源代码并解压,将目录下SCAdView文件夹添加到你的项目中

CocoaPods

创建或在你的 podfile中添加:

pod 'SCAdView'

然后到终端cd到目录下执行 pod install

用法

在使用的时候,我们应该通过一个SCAdViewBuilder对象来构造出SCAdView,而我们可以通过在构造方法中修改buidler中的属性,来定制一个我们想要的 SCAdView
eg.

    SCAdView *adView = [[SCAdView alloc] initWithBuilder:^(SCAdViewBuilder *builder) {
        builder.adArray = arrayFromService;
        builder.viewFrame = (CGRect){0,100,self.view.bounds.size.width,self.view.bounds.size.width/2.f};
        builder.adItemSize = (CGSize){self.view.bounds.size.width/2.5f,self.view.bounds.size.width/4.f};
        builder.minimumLineSpacing = 0;
        builder.secondaryItemMinAlpha = 0.6;
        builder.threeDimensionalScale = 1.45;
        builder.itemCellNibName = @"SCAdDemoCollectionViewCell";
    }];

SCAdViewBuilder 的详解

请到SCAdView.h文件查阅SCAdViewBuilder的 interface。

效果

水平滚动效果 垂直滚动效果

相关文章

网友评论

  • OnceChange:有个问题:
    刚滑动一个 cell 到前面,随即点击最前面的 cell。此时 点击并没有反应。等待一会(动画做完)再次点击是可以的。
    请问这个动画是哪里设置的,可以屏蔽么?
    陈小翰:描述有点不清楚,很难给你定位到问题,滑动一个cell到前面,前面是指最中间吗?
    陈小翰:@OnceChange
    QQ:
    284766710
    OnceChange:作者,怎么可以联系你?
  • 陶小亮:用了你这个之后为什么自定义的collectionViewCell 里面的 按钮,textField等都没有响应了??
  • JanzTam:6啊
    陈小翰:@JanzTam :joy:

本文标题:[iOS]定制性强的广告轮播图--SCAdView

本文链接:https://www.haomeiwen.com/subject/pcrbittx.html