Need help with HorizontalScrollView

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Need help with HorizontalScrollView

Postby totsie » Thu Jan 21, 2010 2:34 pm

Hope someone can help me with my very simple problem.

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

Code: Select all
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/scrollview"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

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

        <ImageView
            android:src="@drawable/icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
       
    </LinearLayout>
</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
totsie
Freshman
Freshman
 
Posts: 2
Joined: Thu Jan 21, 2010 1:00 pm

Top

Postby totsie » Thu Jan 21, 2010 2:59 pm

I have found that I can do the same thing using the android.widget.Gallery class!

For those who want a link http://developer.android.com/resources/ ... llery.html

-- Totsie
totsie
Freshman
Freshman
 
Posts: 2
Joined: Thu Jan 21, 2010 1:00 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Google [Bot] and 1 guest