使用Yalantis / Koloda库加载超过1个UIView [英] using Yalantis/Koloda library to load more than just 1 UIView
问题描述
func kolodaViewForCardAtIndex(koloda:KolodaView,index:UInt) - > UIView {
}
只返回UIview。有什么建议么。
我已经完成了以下工作。
创建一个自定义接口(.xib)视图和类(在我的例子中称为CustomView)
$ $ p $ func koloda(kolodaNumberOfCards koloda:KolodaView) - > UInt {
return UInt(self.run.count)
}
func koloda(koloda:KolodaView,viewForCardAtIndex index:UInt) - > UIView {
let cell = NSBundle.mainBundle()。loadNibNamed(CustomView,owner:self,options:nil).first as? CustomView
let runs = self.run [Int(index)]
cell!.textLabel!.text = runs.type
return cell!
}
So I'm using this library and in the example provided only static images are used to load into each card. however I want to customize the look and feel of the each card with labels, multiples UImages etc that i will load from parse.com . How can I achieve this. the function func kolodaViewForCardAtIndex(koloda: KolodaView, index: UInt) -> UIView {
}
Only return UIview. Any suggestions.
I've done the following and it works. Create a custom interface (.xib) view and class (in my example its called "CustomView")
func koloda(kolodaNumberOfCards koloda:KolodaView) -> UInt {
return UInt(self.run.count)
}
func koloda(koloda: KolodaView, viewForCardAtIndex index: UInt) -> UIView {
let cell = NSBundle.mainBundle().loadNibNamed("CustomView", owner: self, options: nil).first as? CustomView
let runs = self.run[Int(index)]
cell!.textLabel!.text = runs.type
return cell!
}
这篇关于使用Yalantis / Koloda库加载超过1个UIView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!