Comments (7)
@623034345 Demo有的呢。
let bannerDemo = LLCycleScrollView.llCycleScrollViewWithFrame(CGRect.init(x: 0, y: titleDemo.ll_y + 80, width: w, height: 200), imageURLPaths: imagesURLStrings, titles:titles, didSelectItemAtIndex: { index in
print("当前点击图片的位置为:\(index)")
})
from llcyclescrollview.
只能初始化的时候用吗? 能单独调用吗? 刚学Swift 对block不熟悉0.0
from llcyclescrollview.
@623034345 这边我写初始化的时候给闭包赋值呢,点击才回调呢。如果没实现闭包,就没有回调的。
from llcyclescrollview.
哦,谢谢了
from llcyclescrollview.
也可以在初始化之后调用,如下:
- 声明一个回掉方法:
func llDidSelectItemAtIndex(index: Int){
print("轮播图的第\(index)项被点击了")
}
- 赋值
bannerDemo.lldidSelectItemAtIndex = llDidSelectItemAtIndex(index:)
from llcyclescrollview.
@zanyzephyr 不用这么麻烦呢,实现代码逻辑较多,可以在回调里面去调用你声明的方法呢。
bannerDemo.lldidSelectItemAtIndex = { index in
tapAction(index)
}
或者直接在初始化的时候去调用
let bannerDemo = LLCycleScrollView.llCycleScrollViewWithFrame(CGRect, imageURLPaths: imagesURLStrings, didSelectItemAtIndex: { index in
tapAction(index)
})
func tapAction(_ index: Int) {
// Action Code
}
from llcyclescrollview.
@LvJianfeng 第一种写法简洁了好多👍
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.