omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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?

    Pythonista
    view presentation present
    3
    6
    2714
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • shinyformica
      shinyformica last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • pulbrich
        pulbrich last edited by pulbrich

        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)

        1 Reply Last reply Reply Quote 0
        • JonB
          JonB last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • shinyformica
            shinyformica last edited by

            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.

            1 Reply Last reply Reply Quote 0
            • JonB
              JonB last edited by

              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...

              1 Reply Last reply Reply Quote 0
              • shinyformica
                shinyformica last edited by

                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.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Powered by NodeBB Forums | Contributors