• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

YXJCycleView: 任意组件的banner图,轮播图,可以是图片,可以是任意的view,即将到来 ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

YXJCycleView

开源软件地址:

https://gitee.com/EasySwift/YXJCycleView

开源软件介绍:

YXJCycleView

任意视图的无限循环轮播图,可以是本地图片,可以是任意的view,可以是远程图片,再加文字描述岂不更好,pageController也支持高度自定义。几乎可以满足所有循环视图的需求,不仅是轮播组件,做app首次安装或者更新的介绍页也照样能胜任。支持缓存

Join Us

为了更好的完善EasySwift框架,希望更多对此框架有兴趣的朋友一起加入进来打造最好用最全面扩展最好的swift框架。EasySwift官方QQ群:542916901

Mark

先更新Github上的项目,所以最新的项目一定在Github上。

Features

  • 本地图片轮播图
  • 远程图片轮播图
  • 任意视图轮播图
  • 无限循环
  • pageController高度自定义
  • 缓存支持
  • 可以用作app介绍页

ScreenShot

image

System Requirements

iOS 8.0 or above

Installation

As a CocoaPods Dependency

Add the following to your Podfile:

pod 'YXJCycleView'

Version

V0.0.1 ---- 2016-8-11

  • 首次发版

Example

import UIKitimport YXJCycleViewvar ScreenWidth: CGFloat {    return UIScreen.mainScreen().bounds.width}class ViewController: UIViewController, YXJCycleScrollViewDelegate {    private var cycleView: YXJCycleScrollView?    override func viewDidLoad() {        super.viewDidLoad()        /**         方式一         */        loadLocalImg()        /**         方式二         */        loadLocalView()        /**         方式三         */        loadURLImg()    }    /**     加载本地图片,使用场景,做静态展示或者app首次安装或者更新的介绍页     */    func loadLocalImg() {        self.cycleView = YXJCycleScrollView(frame: CGRect(x: 0, y: 0, width: ScreenWidth, height: 150))        self.view.addSubview(self.cycleView!)        self.cycleView?.backgroundColor = UIColor.whiteColor()        self.cycleView?.autoScroll = false        self.cycleView?.infiniteLoop = false        self.cycleView?.delegate = self        self.cycleView?.localizationImagesGroup = [UIImage.init(named: "init1")!, UIImage.init(named: "init2")!, UIImage.init(named: "init3")!, UIImage.init(named: "init4")!, UIImage.init(named: "init5")!]        self.cycleView?.pageControl.dotColor = UIColor.whiteColor()    }    /**     加载本地任意view     */    func loadLocalView() {        self.cycleView = YXJCycleScrollView(frame: CGRect(x: 0, y: 160, width: ScreenWidth, height: 150))        self.view.addSubview(self.cycleView!)        self.cycleView?.backgroundColor = UIColor.whiteColor()        self.cycleView?.autoScroll = false        self.cycleView?.infiniteLoop = false        self.cycleView?.delegate = self        let v1 = UIView(frame: CGRect(x: 0, y: 0, width: ScreenWidth, height: 150))        v1.backgroundColor = UIColor.brownColor()        let v2 = UIView(frame: CGRect(x: 0, y: 0, width: ScreenWidth, height: 150))        v2.backgroundColor = UIColor.purpleColor()        let v3 = UIView(frame: CGRect(x: 0, y: 0, width: ScreenWidth, height: 150))        v3.backgroundColor = UIColor.orangeColor()        let v4 = UIView(frame: CGRect(x: 0, y: 0, width: ScreenWidth, height: 150))        v4.backgroundColor = UIColor.magentaColor()        self.cycleView?.views = [v1, v2, v3, v4]        self.cycleView?.pageControl.dotColor = UIColor.whiteColor()    }    /**     加载网络图片     */    func loadURLImg() {        self.cycleView = YXJCycleScrollView(frame: CGRect(x: 0, y: 320, width: ScreenWidth, height: 150))        self.view.addSubview(self.cycleView!)        self.cycleView?.backgroundColor = UIColor.whiteColor()        self.cycleView?.autoScroll = true        self.cycleView?.autoScrollTimeInterval = 3        self.cycleView?.infiniteLoop = true        self.cycleView?.delegate = self        self.cycleView?.pageControlAliment = YXJCycleScrollViewPageContolAlimentRight        self.cycleView?.imageURLStringsGroup = [            "http://p0.so.qhmsg.com/bdm/326_204_/t011d35badee89c184a.jpg",            "http://p3.so.qhmsg.com/bdm/326_204_/t01d5cd3cd467db8b4d.jpg",            "http://p1.so.qhmsg.com/bdm/326_204_/t014986d9bc787ba0e1.jpg",            "http://p3.so.qhmsg.com/bdm/326_204_/t012e2e252b709019e3.jpg"        ]        self.cycleView?.titlesGroup = [            "第一张图片的描述",            "第二张图片的描述",            "第三张图片的描述",            "第四张图片的描述"        ]        self.cycleView?.pageControl.dotColor = UIColor.whiteColor()    }    // MARK:cycle    func cycleScrollView(cycleScrollView: YXJCycleScrollView!, didSelectItemAtIndex index: Int) {        print(index)    }    func cycleScrollView(cycleScrollView: YXJCycleScrollView!, didSwipeItemAtIndex index: Int) {        print(index)    }    override func didReceiveMemoryWarning() {        super.didReceiveMemoryWarning()    }}

极致框架

  • EasySwift是从2014年开始打造的贯穿整个Swift开发的整套解决方案,只为最简单,最高效,最全面,高扩展性,囊括最前沿的架构,思想在其中EasySwift

License

EasyEmoji is licensed under the Apache License, Version 2.0 License. For more information, please see the LICENSE file.


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap