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);这个方法参数效果是纵向向下滑动,,想改成从左向右滑动 ,一直不明白这个参数该怎么写,有没有知道的朋友指点一下

解决方案 »

  1.   


    前面四个参数是x坐标的,后面四个参数是y坐标,所以这样改
    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);
      

  2.   

    这种问题。。猜猜也是应该改后面两个吧。。
    倒数第二个RELATIVE_TO_SELF改成0.0,最后一个RELATIVE_TO_SELF改成-1.0.试试呢
      

  3.   

    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);
    参考这个文档