gpt4 book ai didi

ios - 如何在 iOS 上设置 SBPickerSelector 的默认值(非日期)

转载 作者:行者123 更新时间:2023-11-30 11:36:52 25 4
gpt4 key购买 nike

对于这个选择器库 Busta117/SBPickerSelector在 iOS 上,如何为具有 numberOfComponents = 2.text 类型设置默认值?

我目前的显示方式如下:

let picker = SBPickerSelector()
picker.delegate = self
picker.numberOfComponents = 2
picker.pickerType = .text
picker.pickerData = [["3", "4", "5", "6", "7", "8", "9", "10"],
Array(repeating: "", count: 13).enumerated().map{"\($0.0) in"}]

picker.pickerId = "height"
picker.doneButtonTitle = "Done"
picker.cancelButtonTitle = "Cancel"

picker.showPickerOver(self)

最佳答案

picker.pickerView 包含 UIPickerView,因此您可以:

picker.pickerView.selectRow(<row: Int>, inComponent: Int>, animated: Bool)

关于ios - 如何在 iOS 上设置 SBPickerSelector 的默认值(非日期),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49660523/

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