[WARN] New layout set while view [object TiUIView] animating: Will relayout after animation.

You must Login before you can answer or comment on any questions.

Hello,

does anyone know the best practice to follow to resolve the Will relayout after animation. warnings ?

Everything works as expected but it's annoying seeing a warning without possibility to resolve it.

Only reference in JIRA found is: QE-224

Happens both in iOS Simulator and in devices. Latest 2.1.0 CI build.

4 Answers

I dont think is your fault, except if you do something like

view.animate({left:100});
view.left = 150;
In this case Ti will wait for the animation to end then do the layout. To get over it you can try to set the left property when the animation ends
view.animate({left:100}, function(){
    view.left = 150;
});

— answered 12 months ago by Dan Tamas
answer permalink
1 Comment
  • Unfortunately that's not the problem, anyway thanks for your support Dan.

    I tracked down being the concurrent animations on siblings.

    Basically in the first case I'm doing a CoverFlow-like control where I loop and start one animation for each cover (TiUIView). If I go through the loop stepping in TiStudio no warnings appear, if I set breakpoints right before and after the loop the warnings appear. The container view has an absolute layout.

    In the second, simpler, case I have an audioplayer-like set of buttons that slides out of window once clicked or after some inactive time and a sibling button that slides in and reverts the animations on tap:

    sibling.animate(Titanium.UI.createAnimation({ duration: 500, bottom: 0 })); audioUI.animate(Titanium.UI.createAnimation({ duration: 250, bottom: -80 }));

    — commented 12 months ago by Marco Del Tongo

AudioUI is a child for sibling? As far as I know Ti doesn't play well with animation for both parent and kid view.

As an aside, you can always do this:

view.animate({bottom:0, duration:500})
No need to create an animation.

— answered 12 months ago by Dan Tamas
answer permalink
1 Comment
  • Hello Dan,

    still no luck,

    they are two views in the same window, that's their only relationship.

    I'm also noticing on Instruments that the animations don't get collected even if they aren't referenced anywhere else as I simplified the calls like you suggested.

    The warning is shown also in the KitchenSink Animation examples.

    — commented 12 months ago by Marco Del Tongo

Is it safe to ignore this warning? I believe something like it came up before and the general consensus was to ignore it until Appcelerator fixed it. What is it trying to tell us? I have a rather big animated menu, and I get about 100 of these warnings, but nothing appears to be wrong with the layout.

— answered 12 months ago by Ian Tearle
answer permalink
1 Comment
  • Yes, there was a similar warning while the layout was being refactored that could be ignored.

    In my case I'm also noticing in Instruments that some TiAnimation objects don't get collected, are those of your menu all removed from memory ?

    I think it's mostly annoying to see that bunch of warnings without a clear way to clear them.

    — commented 12 months ago by Marco Del Tongo

Your Answer

This question has been locked and cannot accept new answers.