How can I initiate Core Animation on the animator proxy during a call to resizeSubviewsWithOldSize?

I have some NSViews that I insert into one of two layouts depending on the size of my window.

I adjust the layout when the corresponding supervisor gets the resizeSubviewsWithOldSize method.

This works, but I would like to revitalize the change. Therefore, of course, I tried calling the animator proxy when I set new frames, but the animation will not work while the user is still dragging. If I release the mouse until the animation is planned, I can see the tail of the animation, but nothing before that. I tried to make sure kCATransactionDisableActions is set to NO, but that didn't help.

Can I start a new animation and start it while resizing?

+3
source share
2 answers

I don’t think you can do it easily, because the CA animation runs through a timer, and the timer does not fire during runloop modes that are active while the user is dragging and dropping.

If you can control the runloop while dragging the user, play around with the runloop modes. This will make it work. I don’t think you can change it on the CA side.

+2
source

This is really not an answer, but I would advise you not to animate anything by dragging it to resize the window. The screen is already animating (it moves from the window) - further animations are likely to be visually confusing and extraneous.

CoreAnimation - , , , , ( ). , .

0

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


All Articles