0

I'm using the native MonoTouch.Dialog support for Pull to Refresh feature on iOS, however since in iOS 7 view controllers can be shown in fullscreen mode (below the navigation bar and status bar) the Pull to Refresh feature stopped working properly.

I tried to play with TableView.ContentOffset and TableView.ContentInset properties in my MonoTouch.Dialog.DialogViewController subclass but I could not find any point of customization. MonoTouch.Dialog.DialogViewController uses a lot of private constants / fields / classes, which makes difficult to extend it.

Also the https://github.com/migueldeicaza/MonoTouch.Dialog looks outdated.

Is anyone successfully using Pull to Refresh feature in iOS 7 with MonotTouch.Dialog?

1

2 Answers 2

1

Ok, I suddenly realized that my app deployment target is iOS >= 6.x (I have recently dropped support for iOS 5) so I can use the UIKits native UIRefreshControl instead, which scales will with both iOS 6 and iOS 7 ;).

1
0

I had the same problem and had a different solution. I was doing the following

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

I was immediately calling ReloadComplete, this is bad dont do this

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

You need to wait just a little before refreshing...

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

btw, the original problem looks like it was fixed on github by bhomles: https://github.com/migueldeicaza/MonoTouch.Dialog/issues/190

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.