버튼 클릭, 아래에서 나타나는 단편에 애니메이션을 추가하려고합니다.Android : 조각을 위로 밀어내는 방법?
조각 레이아웃
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="50dp"
android:background="@color/wallet_holo_blue_light"
android:layout_gravity="center"
android:text="This is a fragmentt layout"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />
</RelativeLayout>
슬라이드 여기를 호출
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@android:integer/config_mediumAnimTime">
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@android:integer/config_mediumAnimTime"
android:fromYDelta="50.0%p"
android:interpolator="@android:anim/decelerate_interpolator"
android:toYDelta="30" />
</set>
up.xml :
public void onClick(View view) {
if(view == button){
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
FragmentOnMap hello = new FragmentOnMap();
fragmentTransaction.add(R.id.fragment_container, hello, "HELLO");
fragmentTransaction.setCustomAnimations(R.animator.slide_up,0);
fragmentTransaction.commit();
}
}
Android Fragments and animation
위로 밀어하는 방법을 보여줍니다 아래, 난 그냥 단편 애니메이션 쪽으로. 따라서 setcustomanimation() 함수의 두 번째 인수에 대한 내 질문.커밋 바로 전에 fragmentTransaction.setCustomAnimations()
을 사용해 보았지만 도움이되지 않았습니다.
하단에 표시되지만 전환 효과는 없습니다. 모든 안내가 유용 할 것입니다. 감사합니다.
가능한 중복 http://stackoverflow.com/questions/을 4817900/android-fragments-and-animation) – jakubbialkowski