Skip to content

loadRootFragment 无动画 #541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cgalaxy opened this issue Sep 5, 2017 · 5 comments
Closed

loadRootFragment 无动画 #541

cgalaxy opened this issue Sep 5, 2017 · 5 comments
Labels

Comments

@cgalaxy
Copy link

cgalaxy commented Sep 5, 2017

在activity 布局里有一个占位的framelayout,点击事件会给framelayout 加载 fragment,给framelayout 加载第一个fragment 使用loadRootFragment,没有动画~没有动画~没有动画,使用 public void loadRootFragment(containerId, toFragment,true, true),也没有动画,怎么办 啊啊啊 ,动画去哪里了。试了很多次还是没有辙。请求帮助~~~谢谢

@cgalaxy
Copy link
Author

cgalaxy commented Sep 6, 2017

如果方便,我的qq 1316760523,这样沟通更直接,麻烦啦~

@beilo
Copy link
Contributor

beilo commented Sep 6, 2017

#459 你看看这个对你有帮助么

@cgalaxy
Copy link
Author

cgalaxy commented Sep 6, 2017

#459 是 start( fragment ), 在activity里只能loadRootFragment 呀~ 我在onclick里 这样写试过,没有loadRootFragment 没动画
FragmentA fragmentA = new FragmentA();
fragmentA.setFragmentAnimator(new FragmentAnimator(R.anim.slide_top_in, R.anim.slide_top_down));
loadRootFragment(R.id.fl_container, fragmentA, true, true);
再帮我想一下吧~~~麻烦啦

@iWynn
Copy link

iWynn commented Sep 6, 2017

loadRootFragment 并没有提供动画功能,这个动画需要你自己给framelayout 添加动画效果。动画效果是一进一出时才会有,loadRoot显然只有一个fragment,没有动画很正常啊,你可以loadRootFragment先添加一个空白fragment A,然后在这个fragment A里 start(B),启动真正的fragment.

@YoKeyword
Copy link
Owner

@iWynn @cgalaxy @LonelyMushroom loadRootFragment(int containerId, ISupportFragment toFragment, boolean addToBackStack, boolean allowAnim)loadRootFragment(containerId, toFragment,true, true)时设计是有动画的,只是这是个BUG... 导致使用该方法时,动画无效了

已修复compile 'me.yokeyword:fragmentation:1.1.4'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants