Change DialogFragment enter/exit transition at just before dismissing

后端 未结 5 1862
别那么骄傲
别那么骄傲 2020-12-13 01:48

I have a DialogFragment and I set animation for enter/exit in the onActivityCreated method as below:

  @Override
    public void on         


        
5条回答
  •  鱼传尺愫
    2020-12-13 02:44

    You can set an Up & Down animations for dialog fragment. In 'res/anim' add two files:

    // Slide up animation

    
    
    
        
    
    
    

    // Slide dowm animation

    
    
    
        
    
    
    

    // Style

    
    

    // Inside Dialog Fragment

    @Override
    public void onActivityCreated(Bundle arg0) {
        super.onActivityCreated(arg0);
        getDialog().getWindow()
       .getAttributes().windowAnimations = R.style.DialogAnimation;
    }
    

提交回复
热议问题