【发布时间】:2012-07-24 15:57:24
【问题描述】:
我正在尝试在 Monotouch.Dialog 条目元素中添加一个由 TextFieldShouldReturn 触发的事件。我目前正在尝试附加这样的事件:
//create the entry element
EntryElement newEntry = new EntryElement(thisQuestion.Text, "tap to type", null);
//add should return
newEntry.ShouldReturn(addAnswerToSurvey(newEntry.Value, thisQuestion.Index));
//add the entry to the section
aSection.Add(newEntry);
我在构建时收到错误消息:“MonoTouch.Dialog.EntryElement.ShouldReturn”只能出现在 += 或 -= 的左侧,在“MonoTouch.Dialog.EntryElement”类型之外使用时 (CS0070)
我听说有人无法从 Monotouch.Dialog 语句中获取数据,这似乎是这个错误可能暗示的。所以... 是否有可能实现文本字段应在条目元素上返回委托,如果是这样,如何实现?如果不是,是否只是因为 entry 元素包含一个文本字段?
【问题讨论】:
-
thisQuestion 和 .text 和 .Index 是我的代码中的自定义字符串...
标签: xamarin.ios monotouch.dialog