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.
Change view presentation style after the fact?
-
I'm going to guess the answer to this is "no"...but is it possible to change a View's presentation style after the view has been presented?
So, for example, if I've already presented my view via:view.present(style="full_screen", hide_title_bar=False, hide_close_button=False)
and then, some time later, I want to show the title bar and close button, is there some way to change that without closing the view and re-presenting?
-
How about presenting the view without the title and close box and whenever you need those elements add a subview that would superimpose the main view on the top of the screen, leaving the rest visible? Just an idea, I didn’t try this...
(I mean a button and a label that look like the close box and the title)
-
You may also be able to have your main view be a subviewnof the view you are presenting. Then you can remove it /add it as subview of another view that is presented differently.
-
Yep, that's what I ended up doing. Making my view a subview of a larger view which can show an "x" and title or not.
The answer to my question is a resounding "no"...you can't re-present a view, even after attempting to close it.There might be a way, but it is not worth the ugliness and effort compared to just doing it as suggested above.
-
Are you getting the "xxx view is already being presented...?"
Iirc that is a long standing bug... But iirc if you remove the view controller from the objc object, it can be presented again...
-
Yeah, that's exactly the error I was getting. Got it when trying to reuse a popover view as well.
The result I have by creating my own title bar is actually better for my purposes, so I'll stick with it.Interesting to know about removing the view controller to disconnect the closed view from the animation state of the presenting controller.
Thanks.