在Horizo​​ntalScrollView中自定义视图,不会调用surfaceCreated

时间:2013-06-18 09:33:00

标签: android surfaceview custom-view

我正在尝试在HorizontalScrollView内部安装CustomView。 在根布局中,有三个布局,FrameLayoutRelativeLayout,最后是HorizontalScrollView

我正在添加一个扩展表面视图的自定义视图。 布局XML如下所示

    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/rootlayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal">
    <FrameLayout>
    ..
    ..
    </FrameLayout>
    <RelativeLayout>
    ..
    ..
    </RelativeLayout        
    <HorizontalScrollView 
    android:id="@+id/audio_scroll_view"
    android:layout_width="match_parent"
    android:layout_height="80dip"
    android:layout_marginTop="90dip"
    android:layout_marginRight="90dip"
    android:background="@drawable/controller_bgnd" 
    >
    <com.com.ffplayer.AudioWaveView
    android:id="@+id/audio_waves"
    android:layout_width="500dip"
    android:layout_height="80dip"
    />

    </HorizontalScrollView>
    </FrameLayout>        

此处AudioWaveViewextends SurfaceView的自定义视图。 但surfaceCreated函数永远不会被调用。 如果需要在HorizontalScrollView内实现自定义视图,或者如果它是根布局中其他布局的兄弟,请告诉我必须完成的任何事情。 因为我已经在根布局中实现了类似的自定义视图,只有一个视图,并且工作正常。

0 个答案:

没有答案
相关问题