Forum Archive

Anchor constraint updates

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.

fezgrshger

thank you bro

192.168.100.1 192.168.1.1 jpg to pdf

Enez Houad

@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

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

Enez Houad

@mikael Thanks for your reactivity !