2014-02-06 3 views
0

메뉴 화면, 화면로드 및 게임 화면이있는 Android 게임을 만들고 있습니다. 이 게임은 슈팅 버블을 기반으로하므로 버블 애니메이션을 메뉴 화면에서 로딩 화면으로 전환하고 싶습니다. 나는 로딩 화면으로 전환 할 수있는 재생 버튼을 클릭 할 때마다 이상적으로,이 거품 이미지 전환으로 아래에서 위로 올라갈 것 : enter image description hereAndroid에서 이미지 전환을 만듭니다.

을 마우스 오른쪽 단추로 지금은 안드로이드 XML 애니메이션을 사용하고 호출하여 :

slide_in_up이
overridePendingTransition(R.anim.slide_in_up, R.anim.slide_out_up); 

:

<?xml version="1.0" encoding="utf-8"?> 
<translate xmlns:android="http://schemas.android.com/apk/res/android" 
android:fromYDelta="100%p" android:toYDelta="0%p" 
android:duration="@android:integer/config_longAnimTime"/> 

및 slide_out_up은 다음과 같습니다

<?xml version="1.0" encoding="utf-8"?> 
<translate xmlns:android="http://schemas.android.com/apk/res/android" 
android:fromYDelta="0%p" android:toYDelta="-100%p" 
android:duration="@android:integer/config_longAnimTime"/> 

맨 아래부터 위로 지나가는 이미지가 포함 된 애니메이션을 만드는 법을 누군가가 말해 줄 수 있습니까? 감사.

+0

ImageView에 애니메이션을 적용해야합니까? –

답변

0

사용이 :

slider.xml :에서 onCreate에 넣어 (고해상도에 넣고/ANIM 폴더)

<?xml version="1.0" encoding="utf-8"?> 
<set xmlns:android="http://schemas.android.com/apk/res/android" 
    android:interpolator="@android:anim/accelerate_decelerate_interpolator" 
    android:shareInterpolator="false" 
    android:fillAfter="true" > 

    <translate 
     android:duration="700" 
     android:fromYDelta="100%" 
     android:toYDelta="0%" > 
    </translate> 

</set> 

()이 OnButtonClick 넣어

Animation animationobj = AnimationUtils.loadAnimation(this, R.anim.slider); 

:

void animation_expand() 
     {    
      imgview.startAnimation(animationobj); 
      animationobj.setFillAfter(true); 
      animationobj.setAnimationListener(new AnimationListener() 
      { 

       @Override 
       public void onAnimationStart(Animation animation) {} 

       @Override 
       public void onAnimationRepeat(Animation animation) {} 

       @Override 
       public void onAnimationEnd(Animation animation) {} 
      }); 
     } 
+0

그거 작동합니까? –

관련 문제