gpt4 book ai didi

ios - 如何将选项集作为滚动位置的参数传递?

转载 作者:行者123 更新时间:2023-11-28 10:11:51 24 4
gpt4 key购买 nike

我想将滚动位置的选项集作为参数参数传递,但遇到了一些问题。

谁能写出怎么做?

func selectCurrentWallpaperCell() { //want to pass parameter here
let currentWallpaperID = self.wallpaperManager.currentWallpaperID
if let index = self.wallpapers.index(where: { $0.id == currentWallpaperID }) {
let indexPath = IndexPath(item: index, section: 0)
self.collectionView.selectItem(at: indexPath, animated: true, scrollPosition: UICollectionViewScrollPosition()) // how to use in scrollposition?
}
}

最佳答案

let options: UICollectionViewScrollPosition = [.top, .centeredVertically]
self.collectionView.selectItem(at: indexPath, animated: true, scrollPosition: options)

引用:OptionSet

关于ios - 如何将选项集作为滚动位置的参数传递?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47051383/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com