0
我需要幫助來動畫RelativeLayout。接下來的圖像解釋如何爲我的aplication:RelativeLayout中的動畫滑落
現在,當我觸摸到地圖的標記,它顯示的RelativeLayout(呼叫標記標題中的圖片),並向上滑動效果很好的動畫,不過,我滑下的代碼並不能正常工作,因爲它從屏幕頂部下來。我的代碼是這樣的:
這是它隱藏的RelativeLayout代碼:
public void hideSlideUp() { RelativeLayout slideLayout; slideLayout = (RelativeLayout) findViewById(R.id.sliding_up); if (slideLayout.getVisibility() != View.INVISIBLE) { Animation slide = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.slide_down); slideLayout.startAnimation(slide); slideLayout.setVisibility(View.INVISIBLE); } }
動畫XML文件,現在它的工作錯誤:
<set xmlns:android="http://schemas.android.com/apk/res/android"> <translate android:fromXDelta="0" android:fromYDelta="-1000" android:duration="1000" /> </set>
我使用的第二選項和它工作得很好。非常感謝!! :D – Yeray
很高興它的工作! –