如何让刷卡时进度条增加
How to make the progress bar increase when i swipe the cards
我的应用程序中有一个进度条,在进度条下方我显示了来自 mdel 数组的卡片,它们可以像 tinder 应用程序一样滑动。所以当我刷第一张卡时,进度条应该相应增加,然后第二张卡应该增加,依此类推
现在你提到你正在使用 ZLSwipeableViewSwift,在你的 didEnd 回调中,将进度条值设置为模型数组显示的视图计数。
swipeableView.didEnd = {view, location in
self.progressViewBar.progress = 1.0 * Float(self.swipeableView.numberOfActiveView) / Float(self.wordsData.count)
print("Did end swiping view at location: \(location)")
}
我的应用程序中有一个进度条,在进度条下方我显示了来自 mdel 数组的卡片,它们可以像 tinder 应用程序一样滑动。所以当我刷第一张卡时,进度条应该相应增加,然后第二张卡应该增加,依此类推
现在你提到你正在使用 ZLSwipeableViewSwift,在你的 didEnd 回调中,将进度条值设置为模型数组显示的视图计数。
swipeableView.didEnd = {view, location in
self.progressViewBar.progress = 1.0 * Float(self.swipeableView.numberOfActiveView) / Float(self.wordsData.count)
print("Did end swiping view at location: \(location)")
}