Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
UI-View refuses to present()
-
Strange problem with a simple view: when I try to present it I receive the error message "View is already being presented or animation is in progress"
Which is definitively not true:
in my project I'm using three UI-files which are loaded when needed and closed when their job is done, for example:v = ui.load_view('view2') spin = ui.ActivityIndicator() v.present('sheet') v.add_subview(spin) spin.start() ### several thousand loops which can last 15-30 secs ... spin.stop() v.close() ### another view to display the results (in html): browser = ui.load.view('view3') ### assembly of the html code ... browser.present('full_screen') # => ERROR message ...
As you see the animation was stopped and the view was closed, what am I missing?
Thanks for any hint! -
Could you try adding something like
time.sleep(1)
afterv.close()
(a lower value might work as well)? This could be a bug in theclose
method, perhaps causing it to return before the animation has finished. -
Bingo! :)
I had already thought about inserting a short delay but I first wanted to know if I am using the close() method correctly.
Thank you!