Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scroll entire list View horizontally

Tags:

android

I have a custom list view which contains 14 fields.Something like this:

field1 field2 field3 field4 field5 field6 field7 field8 field9 field10 field11 field12 field13 field14. Now the obvious problem is that is no possible way i can fit all the fields on the screen,so i would like to make the entire list view scroll horizontally,so i could display only 5-6 fields,and when the user scrolls horizontally he will be able to see the rest of them. I is possible to have a list view that scrolls both vertically and horizontally?

like image 691
Roman Marius Avatar asked Dec 04 '12 09:12

Roman Marius


1 Answers

simply create list view inside the horizontal scroll view, skeleton as follows

<HorizontalScrollView ...........>
    <LinearLayout ......>
        <LinearLayout ......>
        //List View Titles will be here
        </LinearLayout>

        <ListView ........ android:layout_weight="1" />

    </LinearLayout>
</HorizontalScrollView>

Here, If you need to show non-scroll-able title to list view then add it in separate layout as like mentioned and don't forget to set layout_weight attribute.

like image 168
Jayabal Avatar answered Oct 01 '22 17:10

Jayabal