0

我在 iOS 上使用原生 MonoTouch.Dialog 来支持 Pull to Refresh 功能,但是由于在 iOS 7 中,视图控制器可以以全屏模式显示(在导航栏和状态栏下方),Pull to Refresh 功能停止正常工作。

我试图在我的子类中使用TableView.ContentOffsetTableView.ContentInset属性,MonoTouch.Dialog.DialogViewController但我找不到任何定制点。 MonoTouch.Dialog.DialogViewController使用了很多私有常量/字段/类,这使得它难以扩展。

而且https://github.com/migueldeicaza/MonoTouch.Dialog看起来已经过时了。

有人在 iOS 7 中通过 MonotTouch.Dialog 成功使用 Pull to Refresh 功能吗?

4

2 回答 2

1

好吧,我突然意识到我的应用程序部署目标是 iOS >= 6.x(我最近放弃了对 iOS 5 的支持),所以我可以使用UIKits nativeUIRefreshControl来代替,它适用于 iOS 6 和 iOS 7 ;)。

于 2013-09-16T18:22:33.087 回答
0

我有同样的问题并且有不同的解决方案。我正在做以下事情

public MyController()
    : base(null)
{
    RefreshRequested += MyController_RefreshRequested;
    Root = new RootElement(null);
}

我立即打电话给 ReloadComplete,这很糟糕,不要这样做

void MyController_RefreshRequested(object sender, EventArgs e)
{
InvokeOnMainThread(
delegate
     {
     ReloadComplete();
     }
}

您需要稍等片刻才能刷新...

void MyController_RefreshRequested(object sender, EventArgs e)
{
     InvokeOnMainThread(
     delegate
     {
          Thread.Sleep(1000);
          ReloadComplete();
     }
}

顺便说一句,原来的问题看起来像是 bhomles 在 github 上修复的:https ://github.com/migueldeicaza/MonoTouch.Dialog/issues/190

于 2013-10-26T21:19:20.163 回答