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.


    How to find out if the orientation change for a Navigation View?

    Pythonista
    2
    4
    2134
    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.
    • kami
      kami last edited by

      Hi,

      i am trying to find out the orientation is changing when a pushed_view for a Navigation View is rotating. I can see the Changing when i am on the root screen with the ui.View layout() function but this function is not running when the Subview is on the screen??

      Thanks a lot.

      Cu kami

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

        I think each push_view'd view needs to implement its own layout method, or else needs to have flex turned on if it can handle auto-layout.

        I am not 100% sure if you push a view, rotate, then go back, if the root view gets notified of layout when it comes back into view. probably...but easy to test.

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

          hi, okay but how to integrate the layout function if i am using pyui files for the different views? If i change the class in the pyui file it gives an error that the load_view function is looking for View().

          thanks a lot.

          cu kami

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

            it would be helpful if you post what you've got as a gist, and we can try to work from there.
            (it is possible, in the file browser menu to select multiple files, then send to gist from the wrench).

            the trick to using custom views in pyui is that the class must be define before you use load_view, it is also possible that you need to pass the class of the view in via the bindings argument, though its been a while...

            It is also possible to define custom classes that load pyui's directly. see
            https://forum.omz-software.com/topic/3176/use-a-pyui-file-in-another-pyui-file/2
            may be useful for how to deal with custom view classes that you want to load from a pyui file.

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