Fragment从上到下进入效果

添加Fragment的入场动画

public void replaceFragment(Fragment fragment) { 
   FragmentManager fragmentManager = getSupportFragmentManager();
   FragmentTransaction transaction = fragmentManager.beginTransaction();    
   //添加Fragment的进入动画  
transaction.setCustomAnimations(R.anim.anim_sild_down,0,R.anim.anim_sild_down,0)
.replace(R.id.frag_container, fragment) 
.commit();}

R.anim.anim_sild_down


 
  
   

你可能感兴趣的:(Fragment从上到下进入效果)