在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:ZCycleView开源软件地址:https://gitee.com/mengqingzheng/ZCycleView开源软件介绍:ZCycleViewA picture/text infinite-scroll library with UICollectionView, It can be very easy to help you make the banner you want 使用
How ToBasic usagepretty easy to use,Basic usage like this let cycleView = ZCycleView(frame: frame)cycleView.placeholderImage = UIImage(named: "placeholder")cycleView.setUrlsGroup(["http://...", "http://...", "http://..."], titlesGroup: ["...", "..."])view.addSubview(cycleView) Set image or image url or textyou can also set the desc /// imagefunc setImagesGroup(_ imagesGroup: Array<UIImage?>, titlesGroup: [String?]? = nil, attributedTitlesGroup: [NSAttributedString?]? = nil)/// image urlfunc setUrlsGroup(_ urlsGroup: Array<String>, titlesGroup: [String?]? = nil, attributedTitlesGroup: [NSAttributedString?]? = nil)/// text onlyfunc setTitlesGroup(_ titlesGroup: Array<String?>?, attributedTitlesGroup: [NSAttributedString?]? = nil) If you want the effect in the picture below, use the following method Special reminder, be sure to set the size, otherwise the picture does not display func setTitleImagesGroup(_ titleImagesGroup: [UIImage?], sizeGroup:[CGSize?])func setTitleImageUrlsGroup(_ titleImageUrlsGroup: [String?], sizeGroup:[CGSize?]) About item settings/// The size of the item, the default cycleView sizevar itemSize: CGSize?/// The scale of the center itemvar itemZoomScale: CGFloat = 1/// The space of itemsvar itemSpacing: CGFloat = 0/// corner radiusvar itemCornerRadius: CGFloat = 0/// item borderColorvar itemBorderColor: UIColor = UIColor.clear/// item borderWidthvar itemBorderWidth: CGFloat = 0 E.g, Effect as shown below cycleView.itemSize = CGSize(width: 240, height: 90)cycleView.itemZoomScale = 1.2 About desc settings/// The height of the desc containerView, if you set the left image, is also includedvar titleViewHeight: CGFloat = 25/// titleAlignmentpublic var titleAlignment: NSTextAlignment = .left/// desc fontpublic var titleFont: UIFont = UIFont.systemFont(ofSize: 13)/// The backgroundColor of the desc containerViewpublic var titleBackgroundColor: UIColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.5)/// titleColorpublic var titleColor: UIColor = UIColor.white/// The number of lines of text displayedpublic var titleNumberOfLines = 1/// The breakMode of lines of text displayedpublic var titleLineBreakMode: NSLineBreakMode = .byWordWrapping About pageControl settings/// Whether to hide pageControl, the default `false`var pageControlIsHidden = false/// Dot color, the default `gray`var pageControlIndictirColor = UIColor.gray/// Current dot color, the default `white`var pageControlCurrentIndictirColor = UIColor.white/// The current dot imagevar pageControlCurrentIndictorImage: UIImage?/// The dot imagevar pageControlIndictorImage: UIImage?/// The height of pageControl, default `25`var pageControlHeight: CGFloat = 25/// PageControl's backgroundColorvar pageControlBackgroundColor = UIColor.clear/// The size of all dotsvar pageControlItemSize = CGSize(width: 8, height: 8)/// The size of current dotvar pageControlCurrentItemSize: CGSize?/// The space of dotvar pageControlSpacing: CGFloat = 8/// pageControl Alignment, left/right/center , default `center`var pageControlAlignment: ZCyclePageControlAlignment = .center/// the radius of dotvar pageControlItemRadius: CGFloat?/// the radius of current dotvar pageControlCurrentItemRadius: CGFloat? didSelectedItem, didScrollToIndexClick and scroll events are in the form of closures or delegate /// scrollToIndexfunc cycleViewDidScrollToIndex(_ index: Int)/// selectedIndexfunc cycleViewDidSelectedIndex(_ index: Int) /// clickvar didSelectedItem: ((Int)->())?/// scrollvar didScrollToIndex: ((Int)->())? Other prototype/// isAutomaticvar isAutomatic: Bool = true/// isInfinitevar isInfinite: Bool = true/// scroll timeIntervalvar timeInterval: Int = 2/// scrollDirectionvar scrollDirection: UICollectionViewScrollDirection = .horizontal/// placeholderImagevar placeholderImage: UIImage? = nil dependencyContact
LICENSEZCycleView is released under the MIT license. See LICENSE for details. |
请发表评论