void Layout (UITableViewCell cell, UIActivityIndicatorView activityIndicator, ImageButton button) { var sbounds = cell.ContentView.Bounds; if (!activityIndicator.Hidden) { activityIndicator.Frame = new RectangleF ((sbounds.Width - _Image.Size.Width) / 2 ,10, _Image.Size.Width, _Image.Size.Height); } else { button.BackgroundColor = UIColor.Clear; button.SetTitle ("", UIControlState.Normal); button.NormalColor = UIColor.Clear; button.DrawImage = true; button.Frame = new RectangleF ((sbounds.Width - _Image.Size.Width) / 2 ,10, _Image.Size.Width, _Image.Size.Height); button.SetBackgroundImage(_Image, UIControlState.Normal); } }