Quantcast
Channel: Active questions tagged uipickerview - Stack Overflow
Viewing all articles
Browse latest Browse all 592

iOS 14 PickerView cutting off text

$
0
0

I Have a pickerview which does not display text properly as off iOS 14. Does anyone know how to fix this? It seems like there is a subview covering the text?

The U is completely cut off

Is it because I'm using a custom label?

func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {        let pickerLabel = UILabel()        let titleData = pickerDataSource[row]        pickerView.subviews[1].backgroundColor = .clear        pickerView.subviews[0].backgroundColor = .clear        let myTitle = NSAttributedString(string: titleData, attributes: [NSAttributedString.Key.font:UIFont.systemFont(ofSize: 18),NSAttributedString.Key.foregroundColor:UIColor.black])        pickerLabel.attributedText = myTitle        return pickerLabel    }

Viewing all articles
Browse latest Browse all 592

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>