Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set rowHeightForComponent for a UIPickerView #294

Open
dvera128 opened this issue Mar 13, 2019 · 0 comments
Open

How to set rowHeightForComponent for a UIPickerView #294

dvera128 opened this issue Mar 13, 2019 · 0 comments

Comments

@dvera128
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant