mardi 19 mai 2015

Scrolling over listiew items not working on device

I want to scroll a portion of data in the screen for which i added scrollview in the layout but the listview is not getting scrolled,its working fine in emulator.I read all articles related to which says listview scrolling is not possible and tried alternatives designing custom scroll but only portion of data is not getting scrolled.Why is this so?No other alternatives?

My layout is something like

<ScrollView
    xmlns:android="http://ift.tt/nIICcg"
    xmlns:tools="http://ift.tt/LrGmb4"
    android:id="@+id/scrollView1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true">
   //few more layout items goes here
 <LinearLayout  android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <ListView android:id="@+id/listView"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:divider="#00000000"
            android:dividerHeight="5dp"
            android:textStyle="bold"
            android:typeface="serif"
            />
        <LinearLayout  android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Total"
                android:textStyle="bold"
                android:textColor="#F5D8BA"
                android:layout_marginRight="30dp"
                android:layout_gravity="center"
                android:typeface="serif"
                />
       </LinearLayout>
 </LinearLayout>
</ScrollView>

and the data inside listview is like

<ScrollView
    xmlns:android="http://ift.tt/nIICcg"
    xmlns:tools="http://ift.tt/LrGmb4"
    android:id="@+id/scrollView1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:fillViewport="true">
<LinearLayout xmlns:android="http://ift.tt/nIICcg"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:layout_weight="1"
    >
<LinearLayout
    android:layout_width="75dp"
    android:layout_height="wrap_content" android:orientation="vertical">

    <TextView
        android:id="@+id/textView1"
        android:layout_gravity="center"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="12dp"
        android:textColor="#000000"
        android:text="TextView"
        android:textStyle="bold"
        android:typeface="serif"
        />

    <TextView
        android:id="@+id/textViewStyle"
        android:layout_gravity="center"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="12dp"
        android:textColor="#000000"
        android:textStyle="bold"
        android:typeface="serif"
        />

</LinearLayout>
   </LinearLayout>
    </ScrollView>

Aucun commentaire:

Enregistrer un commentaire