Reputation: 725
I am trying to create a custom view like a GridView but with the difference of scroll bar functionality. i.e. I want that the GridView should create the column and rows dynamically and must hold a TextView or EditText view inside each cell of the grid and the custom view can be scrolled in vertically and horizontally too.
I have been tried with Table and default Grid Layout but I failed. Any idea, suggestion or comments are welcome.
Thank you.
Upvotes: 0
Views: 67
Reputation: 5953
You should use RecyclerView for this purpose. You will have to declare the number of Columns upfront. You cannot have different number of columns at runtime.
However Horizontal and Vertical Scrolling at the same time is tricky but still can be done.
Checkout: http://belladunovska.com/tech/nested-recycler-view-in-android
There is a talk on the same topic by Android Lead of NewCircle Training
Also you can checkout TwoWayView: https://github.com/lucasr/twoway-view (I think it is not using RecyclerView)
Upvotes: 1