Ian Vink
Ian Vink

Reputation: 68750

Monotouch.Dialog: Enable Selection in UITableView

Using MonoTouch.Dialog I create a table of values.

When the user clicks a row, the row should flash blue as per normal.

How do I enable this in MonoTouch.Dialog?

Upvotes: 2

Views: 1296

Answers (1)

miguel.de.icaza
miguel.de.icaza

Reputation: 32694

MonoTouch.Dialog supports the flashing behavior for Elements that can actually respond to events (like the StringElement when it has a tap-handler attached) or other elements that need to respond to the user's interaction.

This is done by setting the SelectionStyle property on the cell to UITableViewCellSelectionStyle.Blue

Most of the cells that do not respond to user's input have the value in MonoTouch.Dialog set to None. You can either change the source code to make it use Blue everywhere, or make sure that you are using the right Element for the right use case.

I blogged about some design patterns for building Elements recently, if you want to roll your own:

http://tirania.org/monomac/archive/2011/Jan-18.html

Upvotes: 3

Related Questions