// // Utility function that configures the various buttons that we create // static UIButton ButtonWithTitle (string title, CGRect frame, UIImage image, UIImage imagePressed, bool darkTextColor) { var button = new UIButton (frame) { VerticalAlignment = UIControlContentVerticalAlignment.Center, HorizontalAlignment = UIControlContentHorizontalAlignment.Center, BackgroundColor = UIColor.Clear }; button.SetTitle (title, UIControlState.Normal); if (darkTextColor) button.SetTitleColor (UIColor.Black, UIControlState.Normal); else button.SetTitleColor (UIColor.White, UIControlState.Normal); var newImage = image.StretchableImage (12, 0); button.SetBackgroundImage (newImage, UIControlState.Normal); var newPressedImage = image.StretchableImage (12, 0); button.SetBackgroundImage (newPressedImage, UIControlState.Highlighted); button.Tag = kViewTag; // To support reusable cells button.TouchDown += delegate { Console.WriteLine ("The button has been touched"); }; return button; }