저는 LinearLayout, I am dynamically adding TextView, ImageView to that LinearLayout
입니다. 이제이 TextViews와 ImageViews에 OnClickListener를 추가했습니다.레이아웃을위한 슬라이드 인 및 슬라이드 아웃 애니메이션
나는 10 개의 항목이있는 arraylist를 가지고 있는데 for 루프를 사용하여 각각의 값과 표시를 얻고있다. 다음과 이전 버튼이있는 퀴즈 앱이기 때문에 항목을 하나씩 표시하고있다. arraylist에서.
을하고도 나는이에 도움을 주시기 바랍니다 작업이
slideIn = new TranslateAnimation(
TranslateAnimation.RELATIVE_TO_PARENT, 1.0f,
TranslateAnimation.RELATIVE_TO_PARENT, 0.0f,
TranslateAnimation.RELATIVE_TO_PARENT, 0.0f,
TranslateAnimation.RELATIVE_TO_PARENT, 0.0f);
slideIn.setDuration(500);
slideOut = new TranslateAnimation(
TranslateAnimation.RELATIVE_TO_PARENT, 0.0f,
TranslateAnimation.RELATIVE_TO_PARENT, -1.0f,
TranslateAnimation.RELATIVE_TO_PARENT, 0.0f,
TranslateAnimation.RELATIVE_TO_PARENT, 0.0f);
slideOut.setDuration(500);
하지만 시도했다 : Now I need slide In and slide Out animation to apply to this Linear Layout.
나는 이것을 보았다.
편집 :
문제 : 선형 레이아웃이 적용하지만, 무슨 일 난 다음 버튼을 클릭하면 현재의 문제는 왼쪽으로 슬라이드하고 빈 화면이 다음이에서 밀어 옆에 표시하는 것입니다있다 질문을하고 싶지만 현재 질문이 나오면 바로 다음 질문을 따라야합니다.
이 애니메이션을보기에 어떻게 적용 했습니까? –
예 buddy 나는 이것을 선형 레이아웃에 적용했지만 어떤 일이 일어나는지는 다음 현재 질문을 클릭하면 왼쪽 슬라이드와 빈 화면이 슬라이드되어 다음 질문이 표시되지만 현재 질문 슬라이드가 표시되자 마자 다음 질문이 뒤따라야합니다. – Goofy
viewflipper를 사용하고 애니메이션 및 애니메이션을 사용하면 어떨까요? –