android 弹出全局加载等待动画


   /**
     * 弹出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(); }

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM