I have set up a UITextField in order to display a picker view as an input view for this keyboard. I want the picker view to have rounded corners however the area under the corners still displays a background color. pickerView.layer.masksToBound is set to true.
My Code:
dummyTextField.delegate = self
pickerView.delegate = self
pickerView.dataSource = self
pickerView.frame = CGRect(x: 0, y: 0, width: screenWidth, height: 150)
pickerView.backgroundColor = offWhite
pickerView.layer.cornerRadius = 15
pickerView.layer.borderWidth = CGFloat(borderWidth)
pickerView.layer.borderColor = blue.cgColor
pickerView.layer.masksToBounds = true
pickerView.clipsToBounds = true
dummyTextField.inputView = pickerView
dummyTextField.inputView?.clipsToBounds = true
let pickerToolBar = UIToolbar()
let pickerDoneButton = UIBarButtonItem(title: "Done", style: .done, target: self, action: #selector(pickerDone))
pickerDoneButton.tintColor = blue
//I also added the toolbar here
self.window.addSubview(dummyTextField)
