【问题标题】:MonoTouch.Dialog support for Pull to Refresh in iOS 7iOS 7 中的 MonoTouch.Dialog 支持拉取刷新
【发布时间】:2013-09-16 17:32:31
【问题描述】:

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

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

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

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

【问题讨论】:

标签: ios xamarin.ios xamarin ios7 pull-to-refresh


【解决方案1】:

好吧,我突然意识到我的应用部署目标是 iOS >= 6.x(我最近放弃了对 iOS 5 的支持)所以我可以改用 UIKits 本机 UIRefreshControl,它可以同时扩展iOS 6 和 iOS 7 ;)。

【讨论】:

【解决方案2】:

我遇到了同样的问题,但有不同的解决方案。我正在做以下事情

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-11-23
    • 2014-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-14
    • 1970-01-01
    • 1970-01-01
    • 2011-07-05
    相关资源
    最近更新 更多