Resize and Snapshot NSPageController

I have an NSPageController in book mode with two pages, each of which contains an NSTableView. If I launch the application and resize it vertically, and then drag it to another page, then the snapshot used in the scroll animation will have an NSTableView until it is resized. This view only looks at part of the previous review, and it looks awful. Is it possible to get NSPageController to invalidate snapshots when resizing a view?

+4
source share
1 answer

The PictureSwiper example does just that, setting the view frame whenever the window is resized. However, you need to set layout / resizing restrictions. Whenever a view is resized, constraints will also resize NSPageController objects. If you are doing something unique with the layout / size of the view, you will need to manually resize, as in the example above.

In addition, snapshots are generated on the fly. From the arrangedObjects document, the NSPageController documentation:

The delegate will be offered photographs as needed.

And this is useful to keep in mind:

When using portrait mode, if pageController.view supports a layer, live layers are used during the transition instead of snapshots.

+2
source

Source: https://habr.com/ru/post/1488793/


All Articles