我正在开发一个应用程序,允许用户将元数据从 UI 填充到图像中,例如:
有没有办法在 Flutter 中做到这一点?
您可以通过http://metapicz.com/#landing使用任何图片 URL 进行检查
我创建了一个CustomView扩展View.创建一些CustomView并使用动画来移动和旋转它们.更改backgroundResource和错误发生后,新的背景不会填写所有CustomView.请看代码:
clearAnimation();
AnimationSet animation = new AnimationSet(true);
TranslateAnimation translateAnimation = new TranslateAnimation(0, destX - srcX, 0, destY - srcY);
translateAnimation.setInterpolator(new LinearInterpolator());
translateAnimation.setDuration((long) MGConstant.ANIMATE_DURATION);
animation.addAnimation(translateAnimation);
final float finalX = destX;
final float finalY = destY;
animation.setAnimationListener(new AnimationListener() {
public void onAnimationEnd(Animation arg0) {
clearAnimation();
setX(finalX);
setY(finalY);
RotateAnimation rotateAnimation = new RotateAnimation(0, degrees, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation.setInterpolator(new LinearInterpolator());
rotateAnimation.setDuration((long) MGConstant.ANIMATE_DURATION);
rotateAnimation.setFillAfter(true);
startAnimation(rotateAnimation);
resetLayout();
mMoveStatus = false;
degree = degrees;
}
public …Run Code Online (Sandbox Code Playgroud)