Подкласирах EntryElement и зададох UILineBreakMode
в метода GetCell като такъв:
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;
}
}
Това изглежда не прави текста, който се въвежда в клетката, обвит с думи. Трябва ли да настройвам това някъде другаде?
Ако някой знае по-добър подход, това, което се опитвам да постигна на по-високо ниво, е, че искам да създам еквивалента на UITextArea в MonoTouch.Dialog.