1. Check out our app, Forums for Android! Download and leave feedback here!

Need help with HorizontalScrollView

Discussion in 'Android Apps & Games' started by totsie, Jan 21, 2010.

  1. totsie

    totsie New Member
    Thread Starter
    25

    Jan 21, 2010
    3
    0
    25
    Hope someone can help me with my very simple problem.

    I have been trying to implement a horizontalScrollView. Here is my sample code.

    Code (Text):
    1. <HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    2.     android:id="@+id/scrollview"
    3.     android:layout_width="fill_parent"
    4.     android:layout_height="fill_parent" >
    5.  
    6.   <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    7.         android:orientation="horizontal"
    8.         android:layout_width="fill_parent"
    9.         android:layout_height="fill_parent" >
    10.  
    11.         <ImageView
    12.             android:src="@drawable/icon"
    13.             android:layout_width="wrap_content"
    14.             android:layout_height="wrap_content"/>
    15.        
    16.     </LinearLayout>
    17. </HorizontalScrollView>
    I intend to add about 8 ImageViews in my linear horizontal layout ( have shown only 1 for ease of reading), and be able to scroll through them using key presses.

    This code just doesn't run on the emulator though. I get errors like "Application <activity name> has stopped unexpectedly. Please try again later"

    Can anyone help me?

    -- Totsie
     

    Advertisement

  2. totsie

    totsie New Member
    Thread Starter
    25

    Jan 21, 2010
    3
    0
    25

Share This Page

Loading...