Why does my Android transition ignore the TransitionListener?

后端 未结 2 2001
闹比i
闹比i 2021-01-06 15:25

I\'m trying to make a smoothly-updating display by calling TransitionManager.beginDelayedTransition(viewGroup, new AutoTransition()) before updating the display

2条回答
  •  盖世英雄少女心
    2021-01-06 15:30

    I finally found the answer to my question.

    I was calling TransitionManager.beginDelayedTransition on a FrameLayout which did not have children at the time I called, then I added a child.

    This doesn't cause a transition to happen, and no callbacks are called.

    I now check if the ViewGroup I'm calling beginDelayedTransition on has children before doing the call; if it doesn't, I don't bother trying to animate it.

提交回复
热议问题