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);这个方法参数效果是纵向向下滑动,,想改成从左向右滑动 ,一直不明白这个参数该怎么写,有没有知道的朋友指点一下
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
-1.0f, Animation.RELATIVE_TO_SELF, 0.0f);
showaction.setDuration(500);这个方法参数效果是纵向向下滑动,,想改成从左向右滑动 ,一直不明白这个参数该怎么写,有没有知道的朋友指点一下
前面四个参数是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);
倒数第二个RELATIVE_TO_SELF改成0.0,最后一个RELATIVE_TO_SELF改成-1.0.试试呢
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
0.0f, Animation.RELATIVE_TO_SELF, 0.0f);
showaction.setDuration(500);
参考这个文档