关于PopuWindow的弹出方式

从左进入:

out_right_left.xml:





in_left_right.xml :






styles.xml :

 

MyActivity.java:

private MyPopuWindow myPopuWindow;
myPopuWindow = new MyPopuWindow((Activity) context);
myPopuWindow.showAtLocation(((Activity) context).findViewById(R.id.mysetting),Gravity.CENTER_HORIZONTAL, 60,0);

MyPopuWindow.java

this.setAnimationStyle(R.style.Anim_left_in);


从右进入:

Anim:

进入动画设置:

push_right_in.xml:




退出动画设置:

push_right_out.xml:




duration:设置速度 ,300比500快一点。

从底部弹出:

push_bottom_in.xml:





    

    


push_bottom_out.xml:





    

    


styles.xml :

 
    

MyActivity.java:

private MyPopuWindow myPopuWindow;
myPopuWindow = new MyPopuWindow((Activity) context);
myPopuWindow.showAtLocation(((Activity) context).findViewById(R.id.mysetting),Gravity.BOTTOM|Gravity.CENTER_HORIZONTAL, 0,0);

MyPopuWindow.java

this.setAnimationStyle(R.style.Anim_bottom_in);





你可能感兴趣的:(安卓专项)