10
목록보기의 항목에 애니메이션을 적용하려고합니다. 현재 나는 새 항목이 추가 될 때마다 목록 항목에 전환 애니메이션을 적용하고 있습니다. 그러나 이것은 내가 달성하기를 원하는 애니메이션이 아닙니다. 그 때 목록보기에 새 항목이 추가되면 전체 목록보기가 새로 추가 된 항목을 위해 자리를 이동합니다. Android의 목록보기에 애니메이션 추가
현재 내가 사용하고있는 코드는 다음과 같습니다set = new AnimationSet(true);
animation = new AlphaAnimation(0.0f, 1.0f);
animation.setDuration(50);
set.addAnimation(animation);
animation = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0.0f,Animation.RELATIVE_TO_SELF, 0.0f,
Animation.RELATIVE_TO_SELF, -1.0f,Animation.RELATIVE_TO_SELF, 0.0f
);
animation.setDuration(150);
set.addAnimation(animation);
LayoutAnimationController controller = new LayoutAnimationController(set, 1.0f);
l.setLayoutAnimation(controller);
l.setAdapter(listAdaptor);
그리고 버튼을 통해 추가 된 항목
l.startLayoutAnimation();
다른 제안
를 온 클릭하면서 다음과 같은 애니메이션을 달성하기 위해.
'R.anim.slide_top_to_bottom'에서 오류가 발생했습니다. anim을 해결할 수 없거나 필드가 아닙니다. – Nishant
xml을 anim 폴더에 추가 했습니까? – ASH
해당 파일의 코드를 제공 할 수 있습니까? – Nishant