Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个线性布局和小视图(50px - 50px),我要做的就是将此视图移动到父视图(在我的情况下为线性布局)。它不一定是线性布局,但如果可能的话,我希望我的包装器是线性布局。
在父级中移动可绘制对象的正确方法是什么?我的绿色小视图是一个图像(R.drawable.myimage),我希望能够轻松地在父级中移动这个图像,我应该平滑移动
最简单的解决方案是内置TranslateAnimation.
TranslateAnimation
如果你在直线移动,它工作正常。
您可能需要更具体地了解您的需求:它什么时候会动起来?它将遵循哪些类型的路径?