Ajit
Ajit

Reputation: 964

how to add a uipickerview as a sub view in a uitableviewcell using monotouch?

So Kindly tell me how to go about it,or if there is any better way to achieve this drop-down experience keeping the grid intact.Thanks in advance!

Upvotes: 0

Views: 857

Answers (1)

Maxim Korobov
Maxim Korobov

Reputation: 2572

For item 3 in your list: you could use UIPopoverController on a iPad, in which you could place UIPicker or any other controls. Demo: https://github.com/xamarin/monotouch-samples/tree/master/Popovers will help you.

Screenshot of demo

You could fire UIPopoverController in UITableViewSource (UITableViewDelegate) subclass on RowSelected event.

For item 4 in your list: if you want to add UIPicker right in a UITableViewCell, for example, in the last one, you should do such things:

  • Declare your own UITableViewCell subclass, which creates UIPicker within itself;
  • On UITableView.GetCell event check that indexPath points to last one cell. If so, create your custom UITableViewCell.

Upvotes: 2

Related Questions