使用 MonoTouch.Dialog
我添加了 StyledStringElement
元素。
有一个后台任务检索需要更新 element.Value
的详细信息
有没有办法在 element.Value
更新后强制元素更新其文本?
伊恩
最佳答案
如果你想逐个更新这个元素,那么你可以使用类似的东西:
public class MyStyledStringElement {
public void SetValueAndUpdate (string value)
{
Value = value;
if (GetContainerTableView () != null) {
var root = GetImmediateRootElement ();
root.Reload (this, UITableViewRowAnimation.Fade);
}
}
}
一种变体是加载所有内容并更新一次(即为每个 Element
迭代 root.Reload
)。
关于c# - MonoTouch.Dialog:更新元素中的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8496462/