2011-01-26 8 views
2

뷰 플리퍼를 사용하여 두보기 간의 전환을 애니메이션으로 표시하려고합니다. 기본적으로 ViewFlipper는 Out 애니메이션을 In 애니메이션 위에 Z 순서로 배치합니다. 들어오는 애니메이션이 나가는 애니메이션 위에 표시되도록하는 방법이 있습니까?Android ViewFlipper ZOrder

감사

답변

0

당신은 안드로이드 런처에서이 기능을 찾을 수 있습니다. Android는 오픈 소스이므로 복사하여 사용할 수 있습니다.

이 코드를 DragableSpace : http://pastebin.com/CgK8TCQS이라고합니다. 활동에서는 전화 :

setContentView(R.layout.main); 

로 :

<?xml version="1.0" encoding="utf-8"?> 
<de.android.projects.DragableSpace 
    xmlns:app="http://schemas.android.com/apk/res/de.android.projects" 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/space" 
    android:layout_width="fill_parent" android:layout_height="fill_parent" 
    app:default_screen="1"> 
    <include android:id="@+id/left" layout="@layout/left_screen" /> 
    <include android:id="@+id/center" layout="@layout/initial_screen" /> 
    <include android:id="@+id/right" layout="@layout/right_screen" /> 
</de.android.projects.DragableSpace> 

방금 ​​XML을 사용하여 응용 프로그램을위한 홈 화면을 정의 할 수 있습니다 볼 수 있습니다처럼)

은 (초기 각 뷰를 정의, 권리 왼쪽)이 같은 자세한 내용을 확인 t에 대한

<LinearLayout android:id="@+id/center" 
    android:layout_width="fill_parent" android:layout_height="fill_parent" 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" android:background="@color/orange"> 
    <Button android:text="Initial Screen" android:id="@+id/Button2" 
     android:layout_width="fill_parent" android:layout_height="wrap_content" 
     android:padding="10dp" android:layout_margin="10dp"> 
    </Button> 
</LinearLayout> 

그의 질문 : Developing an Android Homescreen

+0

나는 비슷한 해결책을 가지고 끝났다. 방금 FrameLayout 주위에 내 자신의 객체를 작성하고 레이어를보다 구체적으로 컨트롤러로 지정했습니다. 이제는 잘 작동하는 것 같습니다. – Aaron

관련 문제