shared element transition works with FragmentTransaction.replace() but doesn't work with FragmentTransaction.add()

前端 未结 3 644
囚心锁ツ
囚心锁ツ 2020-12-14 16:54

The new Shared Element Transitions works when i use Fragment \'replace\' but i can\'t seem to make it work fragment \'add\'. I use the same container in bo

3条回答
  •  时光说笑
    2020-12-14 17:44

    I know this is an old question but recently i had the same problem: .replace was not an option.

    I had to use .Hide and .Add and what worked for me was to set:

    setReorderingAllowed(true) 
    

    on the transaction.

提交回复
热议问题