Git Product home page Git Product logo

sgadvertscrollview's Introduction

SGAdvertScrollView

效果图

Dependency

SDWebImage

SGAdvertScrollView 集成

  • 1、CocoaPods 导入 pod 'SGAdvertScrollView'

  • 2、下载、拖拽 “SGAdvertScrollView” 文件夹到工程中

代码介绍(详细使用,请参考 Demo)

例一

    _advertScrollView.titles = @[@"常见电商类 app 滚动播放广告信息", @"采用代理模式封装, 可进行事件点击处理", @"建议去 github 上下载"];
    _advertScrollView.delegate = self;

代理方法

    - (void)advertScrollView:(SGAdvertScrollView *)advertScrollView didSelectedItemAtIndex:(NSInteger)index {
        DetailViewController *nextVC = [[DetailViewController alloc] init];
        [self.navigationController pushViewController:nextVC animated:YES];
    }

例二

    NSArray *topTitleArr = @[@"聚惠女王节,香米更低价满150减10", @"HTC新品首发,预约送大礼包", @"“挑食”进口生鲜,满199减20"];
    NSArray *bottomSignImageArr = @[@"hot", @"", @"activity"];
    NSArray *bottomTitleArr = @[@"满150减10+满79减5", @"12期免息+免费试用", @"领券满199减20+进口直达"] ;
    
    _advertScrollView2.advertScrollViewStyle = SGAdvertScrollViewStyleMore;
    _advertScrollView2.topTitles = topTitleArr;
    _advertScrollView2.bottomSignImages = bottomSignImageArr;
    _advertScrollView2.bottomTitles = bottomTitleArr;
    _advertScrollView2.bottomTitleColor = [UIColor redColor];

问题及解决方案

1、CocoaPods 安装 SGAdvertScrollView 时,遇到的问题及解决方案

  • 若在使用 CocoaPods 安装 SGAdvertScrollView 时,出现 [!] Unable to find a specification for SGAdvertScrollView 提示时,打开终端先输入 pod repo remove master;执行完毕后再输入 pod setup 即可 (可能会等待一段时间)

2、SGAdvertScrollView 滚动存在混乱问题及解决方案(只有 SGAdvertScrollView 的高度或其父视图的高度不为整数时,才会出现)

  • 解决方案:高度取整 ceil(SGAdvertScrollView 高度或其父视图高度); 若包装有父视图则父视图高度取整;若无包装父视图则 SGAdvertScrollView 高度取整

版本介绍

  • 2017-7-20 :v1.1.8 修复 UICollectionView 偏移量问题

  • 2017-8-2 :v1.2.0 解决标题无数据引起的崩溃问题

Concluding remarks

sgadvertscrollview's People

Contributors

kingsic avatar

Watchers

heliang 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.