您的位置:首页 > 移动开发 > Android开发

android 弹出全局加载等待动画

2016-01-28 16:41 531 查看
  /**
* 弹出loading动画
*/
public static void showLoading(Activity activity) {
View popView = activity.getLayoutInflater().inflate(R.layout.pop_loading_layout, null, false);
//运行动画
((AnimationDrawable) (popView.findViewById(R.id.carAnim)).getBackground()).start();

loading = new PopupWindow(popView,
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT);
loading.setTouchable(true);
loading.setOutsideTouchable(false);
loading.setBackgroundDrawable(null);
     //获取Activity的内容页
     loading.showAtLocation(activity.getWindow().getDecorView().findViewById(android.R.id.content),
Gravity.START | Gravity.TOP, 0, 0);
loading.update();
}


  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: