因此,我使用这个library,在提供的示例中,只使用静态图像加载到每个卡中。然而,我想自定义的外观和感觉的每一张卡的标签,多个UImages等,我将从parse.com加载。我如何才能做到这一点。函数func kolodaViewForCardAtIndex(koloda: KolodaView,索引: UInt) -> UIView {
}
只返回UIview。有什么建议吗。
发布于 2016-01-04 06:10:23
我已经做了以下工作,并且它起作用了。创建自定义接口(.xib)视图和类(在我的示例中称为"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!
}发布于 2015-08-23 22:45:04
数据源方法
func kolodaViewForCardAtIndex(koloda: KolodaView, index: UInt) -> UIView接受任何UIView。因此,只需创建所需的视图(例如,从xib)并在此方法中返回它。
https://stackoverflow.com/questions/32111556
复制相似问题