Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/204.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android在更改按钮边距时使用动画_Android_Animation_Button_Margin - Fatal编程技术网

Android在更改按钮边距时使用动画

Android在更改按钮边距时使用动画,android,animation,button,margin,Android,Animation,Button,Margin,我使用框架布局来包含一个按钮板 FrameLayout.LayoutParams buttonLayoutParameters = new FrameLayout.LayoutParams( wN, hN); // Add Margin to the LayoutParameters buttonLayoutParameters.setMargins(marginLeft, marginTop, marginRight, margi

我使用框架布局来包含一个按钮板

FrameLayout.LayoutParams buttonLayoutParameters = new FrameLayout.LayoutParams(
            wN, hN);
    // Add Margin to the LayoutParameters
    buttonLayoutParameters.setMargins(marginLeft, marginTop, marginRight,
            marginBottom);
    button.setLayoutParams(buttonLayoutParameters);
在游戏中,按钮可以将位置更改为另一个位置。这时我已经重新使用了

buttonLayoutParameters.setMargins(marginLeft, marginTop, marginRight,
                marginBottom);
但是我还想在位置改变时添加动画。我已经尝试了一些翻译动画,但没有成功。请帮我解决这个问题 多谢各位