How to combine scrolling of ListView and TableLayout in Android - android

I had a ListView and a Table Layout in a horizontal linear layout. I want to combine scrolling of both the views i.e., if I scroll List view, the table layout should also be scrolled and vice versa. I cannot use a scrollview, because it is not recommended to put List view inside a scroll view.
Please suggest,

I don't understand why you would like to put a listview in a scroll view?
Because a Listview already is scrollable as far as i remember...
It sounds a little bit strange.. You have horizontal rows (horizontal linear layout) within a table which are horizontal and vertical rows (rows/colums) within a listview which is already scrollable? And a listview are horizontal rows again..
Edit..
Or i don't understand you well, and you have a listview and a table layout in a horizontal layout. but then you can but the table layout within a scrollview.. this way the scrollview doesn't contain the list view.
Please explain in more detail what you are trying to accomplish!

Well, if the ListView is small enough so that it can be scrolled simultaneously with a TableLayout then maybe you could simply replace the ListView with a LinearLayout and put both the TableLayout and the LinearLayout in a ScrollView.

Related

Android listview items with horizontal scroll

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.

How can i add a Expandable listview to the end of a page in a scrollview?

I need to place an expandable listview to the end of a page that displays some data in a scrollview. Basically the listview contains some user comments for the page. The page contains a lot of dynamic data so that it can be placed in a scrollview only. When i add an expandable listview to the end of the scrollview it falls in the right position. But when i expand the listview & set the parent view to wrap height, a part of the listview get clipped of. How can i handle this. I have tried setting the layoutparams of Parent view to wrap content. But that doesnt work.
PS: The cell sizes of the expandable list items is variable.
EDIT: The structure of my xml is
ScrollView
LinearLayout
Comments layout is inflated here along with some other layouts
Comment layout is
LinearLayout
Expandablelistview
I am tring to set the sizes of parent layout dynamically after calculating in onExpanded & collapsed

Android - Create a Vertical ListView with Horizontal scrollable row

I need a Vertical ListView where each row is a horizontal scrollable list of items.
Each items is an image with a button.
I need the app to be compatible with Android 2.2.
I've read 3 working solutions here
Use a custom Horizontal ListView as rows
Use a ViewPager as rows
ViewPager inside ListView
Use an horizontal ScrollView
These solutions are a bit old and each has their detractors.
So I was wondering, at the current state, is there an "official" solution for my problem?
Or, what is the best one?
If the no of items in the vertical ListView are fixed then you are better off using Horizontal ListViews for each.

how too have Automatic horizontal scrolling of layout in android after few seconds

I have a listview which contains some textview and imageview. i have a horizontal scroll of this layout.
Below this layout i have another layout which is static for all the items of listview. so now I want the listview items to scroll horizontally after few seconds. how can i achieve this.??
Thread are the only answer. You can use modified versions of thread named timer,Handler etc....

ExpandableListView affecting the size of Scrollview when collapsing and expanding

Let me try to explain what I want to achieve. Currently, I have a ScrollView as the main view for my layout and a linearLayout within that to place all of my content into.
In my LinearLayout, I have a bunch of textviews and a gallery, which extends out of the screen, so the user can scroll to see everything. It works.
Now, I want to add an expandableListView to the bottom of all that content, which is still in the linearLayout. The problem is when you expand the list view groups it doesn't affect the ScrollView. I had envisaged that when you expand a group it would make the linearLayout bigger, which in turn makes the scrollview bigger.
Is what I'm thinking achievable?
EDIT:
Ok I think the situation is that listViews are normally placed in a layout by themselves and have scrollviews already enabled. You just set it to fill_parent and it works fine. However, in my case, I'll need the expandableListView to display all content without scrolling, because my ScrollView will deal with that. I don't even think it possible?
It's difficult to answert without seeing your layout xml, but I think that if you set the android:layout_height of the linear layout and expandableListView to wrap_content, the first scrollView must scroll the whole view.
have you tried putting your expandable list into another linear layout and than put it in the scroll views default linear layout?

Categories

Resources