【发布时间】:2012-03-29 06:25:59
【问题描述】:
我继承了 EntryElement 并在 GetCell 方法中设置了UILineBreakMode:
public class EntryElementEnhanced : EntryElement, IElementSizing
{
public EntryElementEnhanced(string caption, string placeholder, string value) : base (caption, placeholder, value) {}
public float GetHeight(UITableView view, NSIndexPath indexPath)
{
return 100.0f; //arbitrary number just for testing
}
public override UITableViewCell GetCell (UITableView tv)
{
var cell = base.GetCell (tv);
cell.TextLabel.LineBreakMode = UILineBreakMode.WordWrap;
cell.TextLabel.Lines = 0;
return cell;
}
}
这似乎不会使输入到单元格中的文本自动换行。我应该将其设置在其他地方吗?
如果有人知道更好的方法,我想在更高级别上完成的是我想在 MonoTouch.Dialog 中创建 UITextArea 的等价物。
【问题讨论】:
标签: c# ios xamarin.ios monotouch.dialog