How do I get alternating row colors in a UITableView using monotouch?
I am currently populating my TableView using this:
public partial class myViewController : UITableViewController
{
public static UINavigationController navigationController;
public static IntPtr handle;
public CompanyViewController (IntPtr handle) : base (handle)
{
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
Services service = new Services();
var myList = service.GetList(param1);
List<string> list = new List<string>();
foreach(var c in myList)
{
list.Add (c.Name);
}
navigationController = NavigationController;
handle = Handle;
var source = new CompanyTableSource(list);
myTableView.Source = source;
}
Pravesh Singh
31-Jan-2014Add this class:
Use it in you tableview:
var tvdelegate = new AlternatingTableViewDelegate()
myTableView .Delegate = tvdelegate