我面临一个奇怪的问题。我用下面的代码创建了 UIPicker。我还使用 IQKeyboardManager 来管理键盘。
let datepicker = UIPickerView()
datepicker.frame = CGRect(x: 0, y: -10, width: UIScreen.main.bounds.width, height: 200)
datepicker.backgroundColor = Constants.Colors.blue
datepicker.tintColor = UIColor.white
textfieldDropDown.inputView = datepicker
textfieldDropDown.inputView?.autoresizingMask = .flexibleHeight
datepicker.delegate = self
datepicker.reloadAllComponents()
临时解决方案 如果我将高度设置为 220,那么由于更高的高度,它不会显示任何间隙。
请告诉我最好的解决方案?