【问题标题】:How to control TranslateAnimation slip direction?如何控制 TranslateAnimation 滑动方向?
【发布时间】:2012-12-19 16:10:33
【问题描述】:
showaction = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f,
             Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
             -1.0f, Animation.RELATIVE_TO_SELF, 0.0f);
             showaction.setDuration(500);

这个方法参数效果是垂直向下滑动,现在我想改变它从左到右滑动。怎么做?

【问题讨论】:

    标签: android translate-animation


    【解决方案1】:
    showaction = new TranslateAnimation(Animation.RELATIVE_TO_SELF, -1.0f,
                 Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
                 0.0f, Animation.RELATIVE_TO_SELF, 0.0f);
                 showaction.setDuration(500);
    

    来自docs

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-09-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-15
      • 2017-06-04
      • 1970-01-01
      • 2013-11-05
      相关资源
      最近更新 更多