i need to make a layout that is scrollable, holds a listview that is not scrollable(full height of the content). So when i scroll the content above the listview is showed, and the full listview is displayed.
Is this possible in android?
what do you mean by ListView ( not scrollable).. will it have predefined items(count) ?
you can have a <ScrollView></ScrollView> inside of which a normal(linear/relative layout say id insidelayout1)
For single item of your ListView, create a separate xml(say item.xml) and try to inflate item.xml into insideLayout1.
Will that work for you.. or detail out your requirement...
If you want to put list view inside the scroll view than you have to fix the height of list view.
otherwise you can't scroll it properly.
Related
I have created a listview inside scrollview. Atfirst it was not scrolling but when it started scrolling then layouts below list view started disappearing from screen. is there any solution to dynamically calculated he height of list view and assign it or is it possible that some how the scrolling of listvew is disabled so that only its items appear on screen like normal layouts or any tags and it does not scrolls???
ListView is deprecated. I would suggest you to use RecyclerView and add nestedScrollingEnabled="true" to your xml or call RecyclerView.setNestedScrollEnabled(true) if you want to wrap adapterview with a scroller. You can also try NestedScrollView for support compability.
Good luck
When I use ExpandableListView inside ScrollView it will show only one item,It is not showing all items and also when selected items it will shows all child items.
If your parent layout contains more items. Then you have to fix the height of listview in form of some dp instead of wrap_content/match_parent, or use NestedScrollView.
I have an android layout setup where I have a ScrollView with some elements and inside that I have a ListView. I am using StackOverflow's answer Android list view inside a scroll view for achieving this feature and it's working fine. My ListView is below some elements like TextView, ImageView. Problem is that when the page is presented ListView get scrolled automatically so that first item in listView is at the top (ie whole scrollview gets scrolled to present listview first item). How can I avoid this auto scrolling?
Add android:descendantFocusability="blocksDescendants" to child of SrollView (and parent of ListView)
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
In my Layout there are some widgets are there in above to the list view. When i scroll through the list view i want to scroll my layout fully.Please any one can suggest the answer
Put the widgets that are presently above the ListView inside the ListView, either by using addHeaderView(), my MergeAdapter, or your own custom Adapter class. The, those widgets will scroll along with everything else in the ListView.