private UIView CreateFooterView(UITableView tableView, string caption)
{
var indentation = UIDevice.CurrentDevice.GetIndentation();
var bounds = tableView.Bounds;
var width = bounds.Width - (indentation * 2);
var footerLabel = new UILabel() { Font = UIFont.SystemFontOfSize(15) };
var rect = new RectangleF(bounds.X + indentation, bounds.Y, width, 0);
footerLabel.Frame = rect;
footerLabel.BackgroundColor = UIColor.Clear;
footerLabel.TextAlignment = UITextAlignment.Center;
footerLabel.LineBreakMode = UILineBreakMode.WordWrap;
footerLabel.TextColor = UIColor.FromRGB(76, 86, 108);
footerLabel.ShadowColor = UIColor.White;
footerLabel.ShadowOffset = new SizeF(0, 1);
footerLabel.Text = caption;
footerLabel.Lines = footerLabel.Font.NumberOfLines(caption, width);
if (tableView.Style == UITableViewStyle.Grouped)
{
footerLabel.BackgroundColor = UIColor.Clear;
}
else
{
var background = Controller.Theme.FooterBackgroundColor;
if (background != null)
{
footerLabel.BackgroundColor = background;
}
}
if (Controller.Theme != null)
{
footerLabel.TextAlignment = Controller.Theme.FooterTextAlignment;
if (Controller.Theme.FooterTextColor != null)
footerLabel.TextColor = Controller.Theme.FooterTextColor;
if (Controller.Theme.FooterTextShadowColor != null)
footerLabel.ShadowColor = Controller.Theme.FooterTextShadowColor;
footerLabel.ShadowOffset = Controller.Theme.FooterTextShadowOffset;
}
return footerLabel;
}
#endregion