lvjianfeng / llcyclescrollview Goto Github PK
View Code? Open in Web Editor NEWSwift - 轮播图,文本轮播,支持左右箭头
License: MIT License
Swift - 轮播图,文本轮播,支持左右箭头
License: MIT License
let escapedString = imagePath.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)
cell.imageView.kf.setImage(with: URL(string: escapedString!), placeholder: placeHolderImage)
每次都会重新加载网络图片,希望可以添加图片缓存,支持
如题. 如果支持 UIPageControl 空心效果就好了.. 比如 外圆是红色. 内园是蓝色 这种效果.
pod 什么还没有没有见1.4x 版本。我刚好用swift4.0写
从第0张图片往后划,page不动
你没适配Swift4啊,你引用的Kingfisher不能自动更新到Swift4,能速度更新一下吗,今天刚更新的
Hi,
Issues still remained.My Xcode is 8.3.3
It's same to #8 #9
file:///xcode/%E6%88%91%E5%9C%A8%E9%87%8D%E5%86%99/xxxx/Main.storyboard: error: IB Designables: Failed to update auto layout status: dlopen(LLCycleScrollView.framework, 1): Library not loaded: .framework/Kingfisher
Referenced from: LLCycleScrollView.framework
Reason: image not found
I pod update the podfile. Then restart my Xcode. Problem still lay there.
2018-03-22 18:39:26.664765+0800 HaoDLSwift[2494:932542] The behavior of the UICollectionViewFlowLayout is not defined because:
2018-03-22 18:39:26.664863+0800 HaoDLSwift[2494:932542] the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.
2018-03-22 18:39:26.665880+0800 HaoDLSwift[2494:932542] The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x10181eaa0>, and it is attached to <UICollectionView: 0x102090000; frame = (0 0; 375 200); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x17004d1d0>; layer = <CALayer: 0x170226540>; contentOffset: {0, -20}; contentSize: {0, 0}> collection view layout: <UICollectionViewFlowLayout: 0x10181eaa0>.
2018-03-22 18:39:26.665949+0800 HaoDLSwift[2494:932542] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.
2018-03-22 18:39:28.865031+0800 HaoDLSwift[2494:932542] The behavior of the UICollectionViewFlowLayout is not defined because:
2018-03-22 18:39:28.865207+0800 HaoDLSwift[2494:932542] the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.
2018-03-22 18:39:28.865972+0800 HaoDLSwift[2494:932542] The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x10181eaa0>, and it is attached to <UICollectionView: 0x102090000; frame = (0 0; 375 200); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x17004d1d0>; layer = <CALayer: 0x170226540>; contentOffset: {0, -20}; contentSize: {375, 131}> collection view layout: <UICollectionViewFlowLayout: 0x10181eaa0>.
2018-03-22 18:39:28.866077+0800 HaoDLSwift[2494:932542] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.
没有值崩溃了.. 还有能不能加一个纯文字的上下滚动的.
My LLCycleScrollView install with Cocoapods. In storyboard, Xcode have a error:
file:///Users/zhangrunliang/Work/TestLLCycleScrollView/TestLLCycleScrollView/Base.lproj/Main.storyboard: error: IB Designables: Failed to render and update auto layout status for ViewController (BYZ-38-t0r): dlopen(LLCycleScrollView.framework, 1): Library not loaded: @rpath/Kingfisher.framework/Kingfisher
Referenced from: LLCycleScrollView.framework
Reason: image not found
file:///Users/zhangrunliang/Work/TestLLCycleScrollView/TestLLCycleScrollView/Base.lproj/Main.storyboard: error: IB Designables: Failed to update auto layout status: dlopen(LLCycleScrollView.framework, 1): Library not loaded: @rpath/Kingfisher.framework/Kingfisher
Referenced from: LLCycleScrollView.framework
Reason: image not found
Can you help me? Thank you very much.
希望 可以在 代理协议中 增加获取当前 显示页数的方法 , 现在我是通过KVO获取的, 但是 为snake时,就不好获取了~ (^__^)
点击回调怎么调用看不懂
platform :ios, '9.0'
install! 'cocoapods', :integrate_targets => false
target "TestCycleView do
pod 'LLCycleScrollView'
end
报错信息:No such module 'Kingfisher'
bannerView.delegate = self
报错:'delegate' is inaccessible due to 'internal' protection level
现在有个需求要在轮播左右加上箭头,但是点击的时候需要控制当前显示的page,找了好久没找到这样的属性,希望下个版本提供一下或者弄个样式选择枚举直接加上左右箭头
初始化的时候没有传frame值,不能正常显示,建议放到layoutSubviews中设置相关代码。比如cellHeight
能单独处理下点击事件吗
new Kingfisher will sup swift 4.2
can you update this ?
下载下来。一运行就报错。。这个是不是需要配置神马?
我希望能自定义pageControl的位置,最好能设置居左居中居右,或者把pageControl这个属性公开出来,我可以在layout里自己控制位置,希望能尽快支持,眼下我只能自己再加一个pageControl了
你好,在这个方法中,当imagePaths为0的时候需要先判断再计算,不然就崩溃了
func pageControlIndexWithCurrentCellIndex(index: NSInteger) -> (Int) {
return Int(index % imagePaths.count)
}
如题
let banner = LLCycleScrollView.llCycleScrollViewWithFrame(CGRect.zero)
self.view.addSubview(banner)
banner.snp.makeConstraints({ (make) in
make.left.equalToSuperview().offset(AdaptedWidth(x: 15))
make.right.equalToSuperview().offset(-AdaptedWidth(x: 15))
make.top.equalTo(self.leftItem.snp.bottom).offset(AdaptedWidth(x: 14))
make.height.equalTo(AdaptedWidth(x: 55))
})
banner.autoScrollTimeInterval = 1
banner.backgroundColor = UIColor.red
banner.scrollDirection = .vertical
banner.customPageControlStyle = .snake
banner.imagePaths = ["公告","活动-1","教程"]
demo里面没写 ....
SKPhotoBrowser.swift
public convenience init(photos: [SKPhotoProtocol], initialPageIndex: Int) {
self.init(nibName: nil, bundle: nil)
*********************
// photos.count = 0
// currentPageIndex = -1
self.currentPageIndex = min(initialPageIndex, photos.count - 1)
*********************
// 崩溃
animator.senderViewForAnimation = photos[currentPageIndex] as? UIView
}
当没有设置imagePaths的时候滑动会出现
如何调整自定义组件框的高度?我只显示一行文字,感觉框有点高遮住图片有点多。
// Demo--延时加载数据之滚动方向控制
let bannerDemo1 = LLCycleScrollView.llCycleScrollViewWithFrame(CGRect.init(x: 0, y: bannerDemo.ll_y + 205, width: w, height: 200))
// 垂直滚动
bannerDemo1.FillPageControlIndicatorRadius = 2;
bannerDemo1.customPageControlIndicatorPadding = 10;
bannerDemo1.customPageControlTintColor = UIColor.red;
bannerDemo1.customPageControlInActiveTintColor = UIColor.white;
bannerDemo1.customPageControlStyle = .snake
scrollView.addSubview(bannerDemo1)
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + .seconds(2)) {
bannerDemo1.imagePaths = imagesURLStrings
}
老铁可以整理一下代码风格吗? 加上 swiftlint gitignore???
fork 了一下,改不动了嘤嘤嘤
We need import it as framework to my project.
2017-10-09 14:07:57.204040+0800[10448:1222328] The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x7fec1d71c860>, and it is attached to <UICollectionView: 0x7fec1f09ac00; frame = (0 0; 414 165.667); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x60400024bdf0>; layer = <CALayer: 0x60400023aba0>; contentOffset: {414, 0}; contentSize: {207000, 165.66666666666663}; adjustedContentInset: {1.4210854715202004e-14, 0, 0, 0}> collection view layout: <UICollectionViewFlowLayout: 0x7fec1d71c860>.
2017-10-09 14:07:57.204131+0800[10448:1222328] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.
2017-10-09 14:08:03.358997+0800[10448:1222328] The behavior of the UICollectionViewFlowLayout is not defined because:
2017-10-09 14:08:03.359166+0800[10448:1222328] the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.
纯文字的字体 颜色 背景 可以修改吗 我都试了 好像不能 能增加一下吗
当用手不断滑动时,下面的分页小圆点没有跟着图片对应 总体体验很好,希望这个库越来越好
本地图可以显示,网络图显示不了
file://......./HomeStoryboard.storyboard: error: IB Designables: Failed to render and update auto layout status for ELHomeViewController : dlopen(LLCycleScrollView.framework, 1): Library not loaded: @rpath/Kingfisher.framework/Kingfisher
Referenced from: LLCycleScrollView.framework
Reason: image not found
代码在模拟器上编译并正确运行。此问题仅影响Interface Builder不呈现自定义@IBDesignable视图。
数量从多张更新为一张时,一张图会滚动轮播,与从一开始设置一张图时不滚动行为不一致
private func initViews() {
// LLCycleScrollView 初始化代码
csvMain.autoScroll = true
csvMain.autoScrollTimeInterval = 5.0
csvMain.imageViewContentMode = .scaleToFill
csvMain.infiniteLoop = true
csvMain.placeHolderImage = UIImage(named: "place_holder_image")
csvMain.coverImage = UIImage(named: "place_holder_image")
csvMain.backgroundColor = UIColor(hexString: ColorRes.transparent)
csvMain.delegate = self
csvMain.customPageControlStyle = .fill
csvMain.pageControlBottom = 14.0
csvMain.FillPageControlIndicatorRadius = 3.6
csvMain.pageControlLeadingOrTrialingContact = 3
}
// 下拉刷新 调用该方法,重置 LLCycleScrollView imagePaths
private func reloadData() {
var imagePaths: [String] = []
for i in 0 ..< bannerData.count {
let baseUrl = bannerData[i]["baseUrl"].stringValue
let imageUrl = bannerData[i]["imageUrl"].stringValue
imagePaths.append(baseUrl + imageUrl)
}
csvMain.imagePaths = imagePaths
// 重置 LLCycleScrollView imagePaths, 后 PageControl 显示错乱,但在一次autoScroll后 恢复正常。
}
请修复该问题。
项目有需求GIF图的展示
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.