RxDataSources
RxDataSources copied to clipboard
How to set rowHeightForComponent for a UIPickerView
Hi, I'm using RxPickerViewAttributedStringAdapter to set up a UIPickerView:
let adapter = RxPickerViewAttributedStringAdapter<[String]>(
components: [],
numberOfComponents: { _,_,_ in 1 },
numberOfRowsInComponent: { (_,_, items,_) -> Int in return items.count },
attributedTitleForRow: { (_,_, items, row,_) -> NSAttributedString? in
return NSAttributedString(string: "\(items[row].firstUppercased)",
attributes: [NSAttributedString.Key.foregroundColor: UIColor.black])
})
Observable.of(["apple", "lemon"]).bind(to: picker.rx.items(adapter: adapter)).disposed(by: disposeBag)
But when I use picker.rx.setDelegate(self).disposed(by: disposeBag) attributedTitleForRow is ignored
How can I solve this???
Thanks!