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.


    Anchor constraint updates

    Pythonista
    3
    5
    1545
    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.
    • mikael
      mikael last edited by mikael

      Some more constraint updates:

      1. When you do not want the Apple standard 8 pt gap between two views, at and dock have a new tight property, which can be used like this:
      at(this_view).tight.top = at(the_other_view).top
      dock(this_view).tight.below(the_other_view)
      
      1. Since views are in their superviews' coordinates, it can be hard to align views that are in different branches of the view hierarchy. Added a way to go via the screen coordinates (using ui.convert_point):
      at(this_view).top = at(the_other_view).top + screen_x
      

      Alternatives here are screen when you have a point (like center) and screen_x/screen_y for single values like in the example above.

      1. Less general, but useful for my project, attributes that react to scrolling of ScrollViews and TableViews:
      at(this_tableview).content_y = at(that_scrollview).content_y
      

      Options here are content_offset for the overall scroll position, or content_x/content_y for just the one dimension.

      Enez Houad 1 Reply Last reply Reply Quote 0
      • fezgrshger
        fezgrshger last edited by fezgrshger

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • Enez Houad
          Enez Houad @mikael last edited by

          @mikael , I regularly use your modules and I thank you for it. Unfortunately, since the last version of ui3, I have an error when I want to use it.
          Here is the Traceback :

          Traceback (most recent call last):
            File "/private/var/mobile/Library/Mobile Documents/iCloud~com~omz-software~Pythonista3/Documents/ui3-master/sheet.py", line 7, in <module>
              from ui3.anchor import *
            File "/private/var/mobile/Library/Mobile Documents/iCloud~com~omz-software~Pythonista3/Documents/ui3-master/ui3/__init__.py", line 12, in <module>
              from ui3.anchor import *
            File "/private/var/mobile/Library/Mobile Documents/iCloud~com~omz-software~Pythonista3/Documents/ui3-master/ui3/anchor/__init__.py", line 821, in <module>
              via_screen,
          NameError: name 'via_screen' is not defined ```
          mikael 1 Reply Last reply Reply Quote 0
          • mikael
            mikael @Enez Houad last edited by

            @Enez-Houad, looks like I missed a push. Sorry for the hassle, please update now.

            Enez Houad 1 Reply Last reply Reply Quote 0
            • Enez Houad
              Enez Houad @mikael last edited by

              @mikael Thanks for your reactivity !

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