专家讲堂相关实现。

三个popupwindow和属性动画配合实现从屏幕上方到中间显示。
pop的使用:
属性动画的使用:
ObjectAnimator
.ofFloat(v, "rotation", v.getRotation(), v.getRotation() + 90)
.setDuration(2000)
.start();
第一个参数我们操作的的对象,第二个我们改变的属性,第三个初始位置,第四个,最终位置。
popupwindow的使用。
直接给pop添加一个动画效果即可实现。
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);

  1.     View view = inflater.inflate(R.layout.popwindowlayout, null);  
    
  2.     // 下面是两种方法得到宽度和高度 getWindow().getDecorView().getWidth()  
    
  3.     PopupWindow window = new PopupWindow(view,  
    
  4.             WindowManager.LayoutParams.MATCH_PARENT,  
    
  5.             WindowManager.LayoutParams.WRAP_CONTENT);  
    
  6.     // 设置popWindow弹出窗体可点击,这句话必须添加,并且是true  
    
  7.     window.setFocusable(true);  
    
  8.     // 实例化一个ColorDrawable颜色为半透明  
    
  9.     ColorDrawable dw = new ColorDrawable(0xb0000000);  
    
  10.     window.setBackgroundDrawable(dw);  
    

http://www.cnblogs.com/Jieth/p/5160487.html

你可能感兴趣的:(专家讲堂相关实现。)