Joh*_*n D 7 c# xamarin.ios monotouch.dialog
我创建了一个类MyStyledStringElement和子类StyledStringElement和IElementSizing,试图控制一个styledstringelement的宽度.不幸的是,下面的代码只调整了getheight()中单元格的高度.是否有一个getWidth()方法,我可以使用或类似的东西来调整styledstringelement的宽度,使它看起来像一个UIButton?一如既往地提前感谢.
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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
551 次 |
| 最近记录: |