zoukankan      html  css  js  c++  java
  • 动画--android图片点击放大动画,并遮挡旁边的控件

    http://blog.csdn.net/s13488941815/article/details/40649823;

    首先是点击放大
    可以使用android自带的缩放动画,因为要遮盖其他控件,就需要控件处在最上层,这里需要调用bringTofront方法
    @Override
    public boolean onTouch(View v, MotionEvent event) {
    // TODO Auto-generated method stub
    switch (event.getAction()) {
    case MotionEvent.ACTION_DOWN:
    v.bringToFront();
    ScaleAnimation scal = new ScaleAnimation(1.0f, 1.4f, 1.0f, 1.4f,
    Animation.RELATIVE_TO_SELF, 0.5f,
    Animation.RELATIVE_TO_SELF, 0.5f);
    scal.setDuration(2000);
    // scal.setFillAfter(true);
    v.startAnimation(scal);
    break;


    default:
    break;
    }
    return false;
    }
    布局方面,需要设置
    下面两个属性
        android:clipChildren="false"
        android:clipToPadding="false"
    这两个属性让控件可以显示在控件本身范围之外

  • 相关阅读:
    什么是透视图?
    Eclipse 视图
    Eclipse 菜单
    Eclipse 窗口说明
    Eclipse 修改字符集
    Eclipse 安装(Oxygen版本)
    Eclipse 教程
    jQuery 教程
    就表单验证说用户体验
    需要配置执行path?no
  • 原文地址:https://www.cnblogs.com/awkflf11/p/5889848.html
Copyright © 2011-2022 走看看