c# - MonoTouch.Dialog:更新元素中的文本

标签 c# ios xamarin.ios monotouch.dialog

使用 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/

相关文章:

ios - 无法将从 XIB 创建的自定义 UIView 子类转换为我需要的类(仅限 UIView)

xamarin - 为什么在 Xamarin.Forms Shell 中使用 ShellSection 时弹出窗口中不显示分隔符?

c# - 使用 DateTime 解析时如何知道时间部分是否存在

ios - 在应用内访问应用

c# - Unity 插件内的 C# 脚本中未触发回调

ios - 以编程方式更改 tabBar 项目?

C#/MonoTouch : how to call an async method when a ViewController is created/appears

c# - 警告 CS0114 : `AnApp.AppDelegate.Self' hides inherited member

c# - 使用 CaSTLe Windsor 解决混合开闭泛型问题

c# - dotNET 堆栈跟踪中的 "line 0"