Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func pickerView(_ pickerView: UIPickerView, attributedTitleForRow row: Int, forComponent component: Int) -> NSAttributedString? {
- let attributedString = NSAttributedString(string: pickerData[row], attributes: [NSForegroundColorAttributeName : UIColor.white,NSFontAttributeName: UIFont.fontWithStyle(.customRegular, fixedSize: 10.0)])
- return attributedString
- }
- func pickerView(pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusingView view: UIView?) -> UIView {
- var label = view as! UILabel!
- if label == nil {
- label = UILabel()
- }
- var data = pickerData[row]
- let title = NSAttributedString(string: data, attributes: [NSFontAttributeName: UIFont.fontWithStyle(.customRegular, fixedSize: 10.0)])
- label?.attributedText = title
- label?.textAlignment = .right
- return label!
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement