2010-10-18 53 views
0

我似乎對普通視圖和SurfaceView沒有任何好運。我有一個有兩個孩子的FrameLayout,一個glSurfaceView和一個ViewAnimator。目的是通過頂部的按鈕進行背景渲染以獲得菜單,選項等。當我使用ViewAnimator進行動畫製作時,它們會按照它們的動作進行動畫,但似乎它們會在某種情況下滾動,就好像它們被部分遮罩一樣(蒙版區域似乎與視圖大小有關)。如果我刪除了glSurfaceView,它的行爲就會正確(即使SurfaceView中的onDraw除glClear之外什麼都不做)。我正要放棄,完全採取另一種方法,但我想我是問有沒有人遇到過這種情況。在SurfaceView上使用ViewAnimator導致問題

主XML

<FrameLayout android:id="@+id/FrameLayout01" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
xmlns:android="http://schemas.android.com/apk/res/android"> 

<include android:id="@+id/glrender" layout="@layout/glview" /> 
<include android:id="@+id/guiscreens" layout="@layout/viewflipper" /> 

</FrameLayout> 

總帳視圖

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> 

    <android.opengl.GLSurfaceView 
        android:id="@+id/glsurfaceview" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent"/> 

</FrameLayout> 

視圖動畫

<ViewAnimator xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/flipper" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" > 

    <include android:id="@+id/first" layout="@layout/mainmenu" /> 
    <include android:id="@+id/second" layout="@layout/otherscreen" /> 

</ViewAnimator> 

的視圖之一

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 

    <Button android:id="@+id/Button01" 
     android:text="CLICK ME" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content"> 
    </Button> 

</LinearLayout> 

我通過文檔閱讀,我認爲我已經修好了一切,但我想我錯過了一些東西。在演示中我找不到任何樣品,完全符合我的要求。我感謝任何意見,謝謝!

回答

1

如果使用平移,縮放或旋轉動畫,當前動畫系統可能無法在SurfaceView上正常工作。這是將來要解決的問題。

+0

嗯,再次感謝,我猜想我現在可以放棄這個想法:) – Handsome 2010-10-19 02:26:49

+0

我們知道什麼時候/如果這個問題得到解決嗎? – stfn 2012-10-10 16:29:14

+0

現在,SurfaceViews支持動畫嗎? – PacificSky 2013-03-27 18:30:32