Comments (7)
@GrsisFee 我尝试了下,没有发生你说的问题额。
// Demo
let bannerDemo = LLCycleScrollView.llCycleScrollViewWithFrame(CGRect.init(x: 0, y:180, width: w, height: 200), imageURLPaths: ["s3.jpg","http://www.g-photography.net/file_picture/3/3587/4.jpg"],
print("当前点击图片的位置为:\(index)")
})
bannerDemo.autoScroll = true
bannerDemo.autoScrollTimeInterval = 5.0
bannerDemo.imageViewContentMode = .scaleToFill
bannerDemo.infiniteLoop = true
bannerDemo.delegate = self
bannerDemo.customPageControlTintColor = UIColor.red
bannerDemo.customPageControlStyle = .fill
bannerDemo.pageControlBottom = 14.0
bannerDemo.FillPageControlIndicatorRadius = 3.6
bannerDemo.pageControlLeadingOrTrialingContact = 3
scrollView.addSubview(bannerDemo)
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + .seconds(10)) {
bannerDemo.imagePaths = imagesURLStrings
}
请确认使用版本,最新版本存在的问题,可截图加DEMO代码哦
from llcyclescrollview.
我使用的版本 是 pod 1.5.0
根据我的经历 应该是:首次异步设置 bannerDemo.imagePaths 时不会出问题。下拉刷新后,第二次异步设置 bannerDemo.imagePaths 时。pageControl 显示错乱。
首次上传图片,不知道上传对了没。😶
@LvJianfeng
from llcyclescrollview.
同是中天人 这张图片 应该是在 第三张的位置。
@LvJianfeng
from llcyclescrollview.
@GrsisFee 嗯,我就是按你说的方式跑的,没重现你的问题。
let imagesURLStrings = [
"s3.jpg",
"http://www.g-photography.net/file_picture/3/3587/4.jpg",
"http://img2.zjolcdn.com/pic/0/13/66/56/13665652_914292.jpg",
"http://c.hiphotos.baidu.com/image/w%3D400/sign=c2318ff84334970a4773112fa5c8d1c0/b7fd5266d0160924c1fae5ccd60735fae7cd340d.jpg",
"http://img3.redocn.com/tupian/20150806/weimeisheyingtupian_4779232.jpg",
];
let imagesURLStrings2 = [
"http://img3.redocn.com/tupian/20150806/weimeisheyingtupian_4779232.jpg",
"http://c.hiphotos.baidu.com/image/w%3D400/sign=c2318ff84334970a4773112fa5c8d1c0/b7fd5266d0160924c1fae5ccd60735fae7cd340d.jpg",
"http://img2.zjolcdn.com/pic/0/13/66/56/13665652_914292.jpg",
"http://www.g-photography.net/file_picture/3/3587/4.jpg",
"s3.jpg",
];
let titles2 = ["1",
"2",
"3",
"4",
"5"
];
let titles3 = ["1-5",
"2-4",
"3-3",
"4-2",
"5-1"
];
let bannerDemo = LLCycleScrollView.llCycleScrollViewWithFrame(CGRect.init(x: 0, y:180, width: w, height: 200), imageURLPaths: imagesURLStrings, titles: titles2, didSelectItemAtIndex: { index in
print("当前点击图片的位置为:\(index)")
})
bannerDemo.autoScroll = true
bannerDemo.autoScrollTimeInterval = 1.0
bannerDemo.imageViewContentMode = .scaleToFill
bannerDemo.infiniteLoop = true
bannerDemo.delegate = self
bannerDemo.customPageControlTintColor = UIColor.red
bannerDemo.customPageControlStyle = .fill
bannerDemo.pageControlBottom = 14.0
bannerDemo.FillPageControlIndicatorRadius = 3.6
bannerDemo.pageControlLeadingOrTrialingContact = 3
scrollView.addSubview(bannerDemo)
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + .seconds(10)) {
bannerDemo.imagePaths = imagesURLStrings2
bannerDemo.titles = titles3
}
你可以把这个代码复制到Demo中的viewcontroller跑一下~😁
from llcyclescrollview.
对了 我用的 xib 的方式。这有影响么?
from llcyclescrollview.
感谢哈,我已经解决了。是在 tableView cell 重用时。会多次赋值 imagePaths, 赋值 imagePaths (我看源码 赋值 该属性时 会致使 pageController 重建),所以 pageController 就显示错乱了
from llcyclescrollview.
@GrsisFee 嗯嗯,好的吧。这种头,一般都是放在header里比较好~👀
from llcyclescrollview.
Related Issues (20)
- 希望能增加pageContrl在图片的下方,距离图片有一定距离的功能。 HOT 1
- swift 4.1 用1.4.0 但 Kingfisher 用的 5.7.0 swift 5 版本的 HOT 1
- 作者,你的gif图能别这么大吗? HOT 2
- LLCycleScrollView放置到屏幕最上面,会自动 把contentOffset设置为-64? HOT 1
- 当轮播非屏宽时,自定义pageControl无效
- 为什么不支持iOS9.0呢
- 滑动触发翻页delegate scrollTo方法的bug
- 包下载好慢
- 偶发崩溃 HOT 2
- 当scrollview宽非全屏时,pagecontrol的frame计算错误
- 也太大了吧,pod 等了一天
- 版本1.6.0 使用图片PageControl,在iOS 13正常,在iOS 14不显示 HOT 6
- 支援webp格式
- 非全屏时,指示器right最右边显示位置不正确
- 继承LLCycleScrollView后没法重写初始化方法
- 开启URL特殊字符处理(isAddingPercentEncodingForURLString)选项后, url包含中文的图片无法显示
- 底部显示文字背景视图部分高度能设置下就最好了,现在默认高度是两行的56,那样显示一行文字不好看,最好是计算下如果一行文字的话30,两行56。
- 图片ContentMode的问题
- 图片验签的功能 没有哦,解密图片
- 当轮播view 的 left 不是0, right 不是0的时候,你的pageUI就有问题
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from llcyclescrollview.