我希望在动画完成后设置按钮的可见性。
这是调用动画的代码:
android.support.v4.app.FragmentTransaction fAnimation = this.getActivity().getSupportFragmentManager().beginTransaction();
fAnimation.setCustomAnimations(android.R.anim.slide_in_left, R.anim.pull_out_to_left);
if (this.isVisible()) {
fAnimation.hide(this);
fAnimation.commit();
}
// code that will be executed when the fragment is gone (after the animation is over)
有没有办法添加监听器以了解我的片段何时消失?
Animation anim = AnimationUtils.loadAnimation(getActivity(), nextAnim); AnimationSet animationWrapper = new AnimationSet(false); animationWrapper.addAnimation(anim); … return animationWrapper;
- Merk