Bir stil oluşturulmuş dizinin genişliğini kontrol etme girişimi için bir sınıf MyStyledStringElement ve alt sınıf StyledStringElement ve IElementSizing oluşturuyorum. Maalesef, aşağıdaki kod yalnızca getheight() içindeki hücrenin yüksekliğini yeniden boyutlandırır. Kullanabileceğim bir getWidth() yöntemi var mı, yoksa bir styledstringelement genişliğini ayarlamak için benzer bir şey var mı, böylece bir UIButton ile aynı göründüğü? Her zaman olduğu gibi şimdiden teşekkürler.monotouch.dialog styledstringelement hücre genişliğini ayarlar
public override UITableViewCell GetCell (UITableView tv)
{
var cell = base.GetCell (tv);
cell.AutosizesSubviews = false;
//tv.TranslatesAutoresizingMaskIntoConstraints = false;
cell.ClipsToBounds = false;
cell.Frame.Width = 30;
cell.Bounds.Width = 30;
cell.Frame.Size = new System.Drawing.SizeF (30, 30);
return cell;
}
#region IElementSizing implementation
public float GetHeight (UITableView tableView, NSIndexPath indexPath)
{
//throw new NotImplementedException();
tableView.Frame.Width = 10;
//tableView.Bounds.Width = 10;
tableView.Frame.Height = 10;
Console.WriteLine (tableView.ToString());
return 10;
}
#endregion