0

I am trying to have a CustomView inside a HorizontalScrollView. In the Root layout there are three Layouts, FrameLayout, RelativeLayout and in the end HorizontalScrollView.

I am adding a custom view which extends surface view. The Layout XML is as below

    <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>        

Here AudioWaveView is a custom view which extends SurfaceView. But the surfaceCreated function is never getting called. Please let me know anything has to be done if custom view needs to be implemented within HorizontalScrollView or if it is a sibling of other layouts in a Root Layout. Because I have implemented similar custom view as just a single view within a Root Layout and it worked.

CRUSADER
  • 5,486
  • 3
  • 28
  • 64
Vasu
  • 1
  • 1

0 Answers0