2013-06-10 2 views
1

첫 번째 Android 앱을 개발하려고합니다. 애니메이션에 관한 많은 기사를 읽었습니다. 이제 내 레이아웃에 ImageView가 있으며 360도 회전시키고 싶습니다. 그리고이 애니메이션은 영원히 반복됩니다. 그래서 여기 내 solteypanim.xml 파일입니다회전 애니메이션에 왜곡 효과가 있습니까?

<set xmlns:android="http://schemas.android.com/apk/res/android" 
    android:interpolator="@android:anim/linear_interpolator" 
    android:ordering="sequentially" > 
    <objectAnimator 
    android:duration="3000" 
     android:propertyName="rotation" 
     android:repeatCount="infinite" 
     android:valueTo="360" 
     android:valueFrom="0" /> 
</set> 

그리고 이것은 내 활동 코드

@TargetApi(Build.VERSION_CODES.HONEYCOMB) 
    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
    ...  
    ImageView solTeyp = (ImageView)findViewById(R.id.solTeyp); 
    AnimatorSet solTeypAnim = (AnimatorSet) AnimatorInflater.loadAnimator(this, R.animator.solteypanim); 
    solTeypAnim.setTarget(solTeyp); 
    solTeypAnim.start(); 
    ... 
    } 

그것은 일하고있어하지만 문제가있다. 변경 중의 값이 선형이 아닙니다. 애니메이션의 시작과 끝 부분에 여유 효과가 있음을 의미합니다. 느리게 시작한 다음 속도를 높이고 속도를 줄입니다. 모든 턴마다 똑같은 문제가 있습니다.

이 완화 효과를 어떻게 비활성화 할 수 있습니까?

+0

집합 [LinearInterpoator (http://developer.android.com/reference/android/view/animation/LinearInterpolator.html)를. –

+0

@ user117, 이미 설정되어 있습니다. xml 파일의 두 번째 줄을보십시오. – Eray

답변

4

정상적으로 답변을 찾았습니다. 선형 보간기를 내 objectAnimator으로 설정해야합니다. 내 이 아니고으로 설정해야합니다. 이와 같이

: 애니메이션에

<set xmlns:android="http://schemas.android.com/apk/res/android" 
    android:ordering="sequentially" > 
    <objectAnimator 
    android:duration="3000" 
    android:interpolator="@android:anim/linear_interpolator" 
     android:propertyName="rotation" 
     android:repeatCount="infinite" 
     android:valueTo="360" 
     android:valueFrom="0" /> 
</set> 
관련 문제