Let's say I have 100 rows of data to show in a ListView. So far no problem. I have a custom adapter for each row, that has a TextView for a date, a TextView for a sequence number and NOW 60 more TextViews, mostly having a two digit number.
How can I get a horizontal scroll to show all these 60 numbers, BUT, the vertical scroll for the Listview should still work, to scroll down from 1 to 100 row, and also, all rows shown on the screen shall scroll horizontal at the same time, not that only one row will scroll horizontal.
Had tried TwoWayView, but only allows to define one direction of scroll.
You need to have a horizontal scrolling list as each ListItem. Although, there are several horizontal scrolling view options, I would recommend using a Recyclerview with a LinearLayoutManager and orientation set to HORIZONTAL.
The general idea is you need a horizontal list as a list item.
Related
I have a horizontally scrolling recycler view that is displaying one row at a time very well. I want to know if it is possible to have the recycler view display five rows in a vertical list format, and then still have it scroll horizontally. Or should I just use paging?
Use GridLayoutManager for multiple Rows. LinearLayoutManager layouts all the items in a single row.
I would like to use horizontall scrolling items in a vertically scrolling Listview.
Note that the items should scroll horizontally independently of the other items, i.e the whole list should not scroll sideways when dragging sideways.
Take vertical scroll first and in that vertical view take a table row and in that row take Horizontal View. Do these as many time as much you need horizontal view in vertical scroll view......
for easy implementation use TABLE and its Rows instead of vertical view
This should be the code for you list-view-item:
<ScrollView
....attrs...>
<!---Your layout---->
</ScrollView>
Use this layout as one row of the list view and this should work well.
Also if you already have a code for the adapter class, you wont have to make any changes to it.
My application requires both horizontal scroll and vertical scroll together. The number of view items in both the direction are dynamic and will be fetched from database 10 at a time (horizontal direction). How can I implement this ?
I tried using listview + horizontal listview (http://www.dev-smart.com/archives/34). But the problem coming is..when I click a button to append next 10 items in a row in horizontal direction. Next stories appended are not being displayed. When i scroll vertically and that particular row is not visible then again when i scroll it back..the next appended stories are visible.
Any solution to my implementation ? or any other suggestion/idea to implement vertical+horizontal scroll which will fulfill my purpose ??
I have a listview and its rows have different heights.
When I scroll up, rows appear to move up or down erratically.
(I don't find the behavior when I scroll down)
I suspect its due to the fact
listView picks one of used rows
the row is placed on top of visible rows.
listView changes the row's height(here erratic movement)
but it's a guess.
I tried googling since this should be a common problem but couldn't find any.
In this case, setting the right item height did the trick :
How to set different heights for each row in a ListView?
Edit: oh, and make sure you recycle the items correctly :
ListView reusing views when ... I don't want it to
i want to display the listview's scroll item by item, means single item height is equal to listview height, so on listview there is only one item will display at a time, and after scrolling the listview, remaining item will display. But problem is that if i scroll listview, it scroll many items, but i need to scroll only by one item.
in-short listview scroll by many row at a time but i want only one row scroll at a time
please suggest me some tips or method :)
thank you
So if I understand you correctly, you want a 'pager', sort of like, you scroll page per page instead of inbetween every item, right?
I'm using a Horizontal Pager at the moment, it uses a GroupView and measures the scroll amount to snap to the next view in the pager. Perhaps you could write your own GroupView as well calculating the scroll Y values to snap to the next page..
It's not going to be easy, but it's the only way I can think of.
You could look up Horizontal Pager on google and look at the code, and implement it for vertical paging :)