代码之家  ›  专栏  ›  技术社区  ›  BekaKK

在运行时添加模糊效果

  •  0
  • BekaKK  · 技术社区  · 6 年前

     int[] locationTo = new int[2];
        secondView.getLocationOnScreen(locationTo);
        int x1 = locationTo[0];
        int y1 = locationTo[1];
    
    
        logo.post(() -> {
            float height = logo.getHeight();
            logo.animate()
                    .x(x1)
                    .y(y1 - (height * 2))
                    .setDuration(5000)
                    .setListener(new Animator.AnimatorListener() {
                        @Override
                        public void onAnimationStart(Animator animator) {
    
                        }
    
                        @Override
                        public void onAnimationEnd(Animator animator) {
    
                        }
    
                        @Override
                        public void onAnimationCancel(Animator animator) {
    
                        }
    
                        @Override
                        public void onAnimationRepeat(Animator animator) {
    
                        }
                    })
                    .start();
        });
    

    这个代码运行得很好。我有两个问题 1) 有没有方法可以检查view的x1和y1运行时? 谢谢

    0 回复  |  直到 6 年前
    推荐文章