1

I'm using monoTouch to program an app with UITextField that show a Popover with results (like the textfield in Google Search with some recomendations). My popover will hide when a cellTable is selected. Everything seems to work normally but when I'm interact to much with it, the Popover delay almost 4 seconds to disappear. This is frustrate to users.

Here is my codes to show a Popover:

partial void showPopover (MonoTouch.Foundation.NSObject sender){
            UITextField from = (UITextField)sender;

            string[] tableItems = {"aaaa","bbbb"};
            var tableController = new UITableViewController();
            var navigationC = new UINavigationController(tableController);

            tableController.Title = from.Placeholder;//dinamico
            UITableView table = new UITableView(from.Frame);
            tableController.View = table;
            table.Source = new PopoverTableSource(tableItems);
            if( popoverController == null ){
                popoverController = new UIPopoverController(navigationC);
                popoverController.PopoverContentSize = new SizeF (320, 320);
            }
            else{
                popoverController.SetContentViewController(navigationC,true);
            }

            popoverController.PresentFromRect (from.Frame, View, UIPopoverArrowDirection.Up, true);
        }

And here is the function to dismiss the Popover:

public void update(int tag, string selectedChart){
            if(popoverController.PopoverVisible){
                popoverController.Dismiss (true);
            }
            popoverController = null;
}
Cœur
  • 37,241
  • 25
  • 195
  • 267
orafaelreis
  • 2,855
  • 2
  • 28
  • 31
  • Is your `update` code called right away and then it takes 4 seconds ? or does it takes 4 seconds to get your `update` called ? – poupou Apr 08 '13 at 15:30
  • **update** is called right away but the fade effect takes +-4 seconds to disappear all the UIPopover. – orafaelreis Apr 09 '13 at 04:07
  • 1
    And this is happening on devices or the simulator? In the simulator there is a debug option for slow animations, is this turned on? Sometimes it gets turned on by accident and you have to restart the simulator. – jonathanpeppers Apr 09 '13 at 17:33
  • It seems correct, the bug not exist on devices. I will try see the slow option in the simulator tomorrow. Thanks @jonathanpeppers ! – orafaelreis May 13 '13 at 01:20
  • Possible duplicate of [iphone simulator suddenly started running very slow](https://stackoverflow.com/questions/15348699/iphone-simulator-suddenly-started-running-very-slow) – Cœur May 13 '18 at 12:05

1 Answers1

0

Solved by @jonathanpeppers and OP

Slow animations is a feature in iOS Simulator.
To disable (or enable), go to Simulator Menu > Debug > Toggle Slow Animations. (Cmd + T).

Cœur
  • 37,241
  • 25
  • 195
  • 267