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

HKCycleViewSwift: Swift语言,轮播图组件,可复用性强:

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

开源软件名称:

HKCycleViewSwift

开源软件地址:

https://gitee.com/Steven_Hu/HKCycleViewSwift

开源软件介绍:

HKCycleViewSwift

CI StatusVersionLicensePlatform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

import UIKitimport HKCycleViewSwiftclass BCBannerCell: UICollectionViewCell,UICollectionViewDelegate {    lazy var cycleView: HKCycleView = {        let view:HKCycleView = HKCycleView()        let images:[UIImage] = [R.image.pic1() ?? UIImage(),R.image.pic2()  ?? UIImage(),R.image.pic3() ?? UIImage(),R.image.pic4() ?? UIImage()]        view.setUrlsGroup(["http://chatm-icon.oss-cn-beijing.aliyuncs.com/pic/pic_20171101181927887.jpg", "http://chatm-icon.oss-cn-beijing.aliyuncs.com/pic/pic_20171114171645011.jpg", "http://chatm-icon.oss-cn-beijing.aliyuncs.com/pic/pic_20171114172009707.png"])        view.setImagesGroup(images, titlesGroup: ["天天特价 -- 超值量贩,底价疯抢天天特价","一缕情丝,一缕温暖","快速匹配,及时推送","气质春装,一件包邮"])        view.itemSize = CGSize(width: BC_SCREEN_WIDTH-80, height: (BC_SCREEN_WIDTH-80)*360/750)        view.itemSpacing = 30        view.itemZoomScale = 1.1        view.itemCornerRadius = 10        view.pageControlItemSize = CGSize.zero        view.backgroundColor = UIColor.white        view.delegate = self        return view    }()        override func layoutSubviews() {        super.layoutSubviews()        self.addSubview(cycleView)        cycleView.frame = CGRect(x: 0, y: 0, width: BCBannerCell.itemHeight().width, height: BCBannerCell.itemHeight().height)    }        public static func itemHeight() -> CGSize {        return CGSize(width: BC_SCREEN_WIDTH, height: 360.scale)    }        func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {            }}//代理方法extension UICollectionViewCell: HKCycleViewProtocol {    public func hk_cycleViewDidScrollToIndex(_ index: Int) {            }    public func hk_cycleViewDidSelectedIndex(_ index: Int) {        BCKeyWindow?.bc_showToast("你点击了第 \(index)个")    }}

效果图

轮播-有文字-Swift轮播-没有文字-Swift

Requirements

Installation

HKCycleViewSwift is available through CocoaPods. To installit, simply add the following line to your Podfile:

#轮播组件pod 'HKCycleViewSwift', :git => 'https://gitee.com/Steven_Hu/HKCycleViewSwift.git'

Author

HJT916109796, [email protected]

License

HKCycleViewSwift is available under the MIT license. See the LICENSE file for more info.


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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