private UITableViewCell UITableViewCellSliderOnlyFactory(UITableView tv)
{
UITableViewCell cell = tv.DequeueReusableCell(CellKey);
if (cell == null)
{
cell = new UITableViewCell(UITableViewCellStyle.Default, CellKey);
cell.SelectionStyle = UITableViewCellSelectionStyle.None;
}
else
RemoveTag(cell, 1);
SizeF captionSize = new SizeF(0, 0);
if (Caption != null && ShowCaption)
{
cell.TextLabel.Text = Caption;
captionSize = cell.TextLabel.StringSize(Caption, UIFont.FromName(cell.TextLabel.Font.Name, UIFont.LabelFontSize));
captionSize.Width += 10; // Spacing
}
if (slider == null)
{
slider = new UISlider(new RectangleF(10f + captionSize.Width, 12f, 280f - captionSize.Width, 7f))
{
BackgroundColor = UIColor.Clear,
MinValue = this.MinValue,
MaxValue = this.MaxValue,
Continuous = true,
Value = this.Value,
Tag = 1
};
slider.ValueChanged += delegate
{
Value = slider.Value;
};
}
else
{
slider.Value = Value;
}
cell.ContentView.AddSubview(slider);
return cell;
}