user1407894
user1407894

Reputation: 61

Not able to scroll all ListView items

I'm not able to scroll all list items. I can scroll it with mouse scroll bar on simulator but if want to scroll it on touch it is not scrolling.

Can somebody help me out ?

   <?xml version="1.0" encoding="utf-8"?>
        <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/scrollView1"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:orientation="vertical" >

            <RelativeLayout
                android:layout_width="fill_parent"
                android:layout_height="768dp" >


                <TextView
                    android:id="@+id/textView1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentTop="true"
                    android:text="Take Photo"
                    android:textAppearance="?android:attr/textAppearanceMedium" />


                <EditText
                    android:id="@+id/editText1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_below="@+id/textView1"
                    android:layout_toLeftOf="@+id/button1"
                    android:ems="10"
                    android:inputType="textPersonName" >

                    <requestFocus />
                </EditText>


                <Button
                    android:id="@+id/button1"
                    style="?android:attr/buttonStyleSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignBaseline="@+id/editText1"
                    android:layout_alignBottom="@+id/editText1"
                    android:layout_alignParentRight="true"
                    android:text="Camera" />


                <TextView
                    android:id="@+id/textView2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_below="@+id/editText1"
                    android:text="Source File"
                    android:textAppearance="?android:attr/textAppearanceMedium" />



                <Spinner
                    android:id="@+id/spinner1"
                    android:layout_width="200dp"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/textView2"
                    android:entries="@array/combolist" />


                <TextView
                    android:id="@+id/textView3"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_below="@+id/spinner1"
                    android:text="What do you want to buy the Look ?" />



                <ScrollView
                    android:id="@+id/scrollView2"
                    android:layout_width="wrap_content"
                    android:layout_height="225dp"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentRight="true"
                    android:layout_below="@+id/textView3" >

                    <LinearLayout
                        android:layout_width="fill_parent"
                        android:layout_height="225dp" >

                        <ListView
                            android:id="@+id/listcheckBox"
                            android:layout_width="fill_parent"
                            android:layout_height="223dp" >

                        </ListView>

                    </LinearLayout>
                </ScrollView>


                <TextView
                    android:id="@+id/textView4"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_below="@+id/scrollView2"
                    android:text="Tag ?"
                    android:textAppearance="?android:attr/textAppearanceLarge" />


                <EditText
                    android:id="@+id/editText2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentRight="true"
                    android:layout_below="@+id/textView4"
                    android:ems="10"
                    android:inputType="textPersonName" android:lines="1" android:maxLines="1" android:scrollHorizontally="true"/>


                <TextView
                    android:id="@+id/textView5"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_below="@+id/editText2"
                    android:text="More information about what you want"
                    android:textAppearance="?android:attr/textAppearanceMedium" />



                <EditText
                    android:id="@+id/editText3"
                    android:layout_width="wrap_content"
                    android:layout_height="150dp"
                    android:layout_alignParentLeft="true"
                    android:layout_alignRight="@+id/textView5"
                    android:layout_below="@+id/textView5"
                    android:ems="10"
                    android:inputType="textMultiLine" android:scrollbars="horizontal|vertical"/>




                <Button
                    android:id="@+id/btnsubmit"
                    android:layout_width="100dp"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/editText3"
                    android:text="Button" />

            </RelativeLayout>

        </ScrollView>  

Upvotes: 0

Views: 655

Answers (2)

Andro Selva
Andro Selva

Reputation: 54322

You can't embed your ListView within ScrollView. ScrollView already has its own Scroll listeners. So when you try to have another view like listView within a view which has its own Gestures it will make your listview to hang up. And in your case I believe just removing the Scroll view alone will make it work correctly

Upvotes: 0

Samir Mangroliya
Samir Mangroliya

Reputation: 40416

Never put your ListView inside ScrollView.And also never put MapView,ListView,WebView inside scrollView.

Because those are already scrolled view itself.And no need to put it in scrollview.so remove it from scrollview.

Upvotes: 2

Related Questions