I have a UIPickerView and it's gigantic by default and I'm not able to resize it.
below functions only resize the part that is selected but I want to make the entire picker view smaller. I don't need to see much of what's above and below the selected item. What would be the best way to do so folks? Thank you!!
func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {
let view = UIView(frame: CGRect(x: 0, y: 0, width: 50, height:30))
let label = UILabel(frame: CGRect(x: 0, y: 0, width: 50, height:30))
label.text = speakerCount[row]
view.addSubview(label)
return view
}
func pickerView(_ pickerView: UIPickerView, rowHeightForComponent component: Int) -> CGFloat {
return 30
}