2016-07-11 2 views
-4

java 클래스에서 xml 값을 변경하고 싶습니다.안드로이드 스튜디오의 java 클래스에서 xml 값을 변경합니다.

이 내 XML 코드 내가

<?xml version="1.0" encoding="utf-8"?> 
<set xmlns:android="http://schemas.android.com/apk/res/android"> 
<rotate 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:fromDegrees="0" 
    android:toDegrees="360" 
    android:pivotX="50%" 
    android:pivotY="50%" 
    android:duration="5000" > 
</rotate> 
</set> 

이 어떻게 자바 클래스

답변

0

이 기능을 사용에서 "toDegrees"값을 변경할 수 있습니다 자바 클래스 "toDegrees"값을 설정할

RotateAnimation (float fromDegrees, float toDegrees, int pivotXType, float pivotXValue, int pivotYType, float pivotYValue);

예를 들어 다음과 같이 구현할 수 있습니다.

RotateAnimation anim = new RotateAnimation(0.0f, 360.0f , Animation.RELATIVE_TO_SELF, .5f, Animation.RELATIVE_TO_SELF, .5f); 
관련 문제