1
나는 내가 InputText]를 내가 InputText]를에 UIToolBar
을 추가 된 피커 를 사용하여 입력보기 오순절이 Swift
4 XCode
9 에 내 프로젝트를 업데이트했습니다. 업그레이드 전에 제대로 작동하고있었습니다. 이제는 UIPickerView
과 같습니다. UIToolBar
이상입니다.UiPickerView - 스위프트 4 업그레이드 오류가
하지만 난 그것을 클릭하면 내가 UIPickerView
내가 정상 TextInput의 도구 모음을 설정할 때의 모습과 잘 작동 있기 때문에, 완벽하게 작동 년대 UIToolBar
클릭 같아요 ..
무엇 될 수 있습니까? 내가 picker.addSubview(toolBar)
그러나 오순절 같은 결과도 시도
var picker: UIPickerView
picker = UIPickerView(frame: CGRect(x: 0, y: 200, width: view.frame.width, height: 300))
picker.backgroundColor = .white
picker.showsSelectionIndicator = true
picker.delegate = self
picker.dataSource = PickerData as? UIPickerViewDataSource
textField.inputView = picker
let toolBar = UIToolbar()
toolBar.barStyle = UIBarStyle.default
toolBar.isTranslucent = true
toolBar.tintColor = .blue
toolBar.sizeToFit()
let doneButton = UIBarButtonItem(title: "Seleziona", style: UIBarButtonItemStyle.plain, target: self, action: #selector(self.doneFunction(_:)))
let spaceButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.flexibleSpace, target: nil, action: nil)
let cancelButton = UIBarButtonItem(title: "Annulla", style: UIBarButtonItemStyle.plain, target: self, action: #selector(self.doneFunction(_:)))
toolBar.setItems([cancelButton, spaceButton, doneButton], animated: false)
toolBar.isUserInteractionEnabled = true
textField.inputAccessoryView = toolBar
:
여기 내 코드입니다.
완벽하게 작동 해 주셔서 감사합니다. – Piedecess