图像在背景中沿曲线路径android移动 [英] Image moving in background along a curve path android
本文介绍了图像在背景中沿曲线路径android移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在开发一个应用程序,其中我希望图像沿着背景屏幕中的曲线路径移动。我能够使用下面的xml转换将图像从一个点移动到另一个点,但是它沿着直线路径移动,我希望它沿着曲线路径运动。
i am developing app, in which i want am image to move along a curve path in the background screen.i am able to move the image from one point to another using the below translate xml, but its moving along a straight path, i want it to move along a curve path.how can i achieve this?
<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="3000"
android:fromXDelta="-20%"
android:fromYDelta="-10%"
android:toXDelta="150%"
android:toYDelta="-130%"
android:zAdjustment="normal" />
请帮助。谢谢!
推荐答案
<rotate
android:toDegrees="360"
android:pivotX="100%"
android:pivotY="200%"
android:duration="6000"
android:repeatMode="restart"
android:repeatCount="infinite"/>
解决方法:我使用了rotate,并使用pivotX和pivotY以及图像位置
Workaround: I used rotate and played with pivotX and pivotY and image position
这篇关于图像在背景中沿曲线路径android移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文