Created
April 11, 2014 11:05
-
-
Save moltak/10458814 to your computer and use it in GitHub Desktop.
ExpandableListView in Scrollview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
View view = inflater.inflate(R.layout.expandable, container, false); | |
ExpandableAdapter adapter = new ExpandableAdapter(); | |
expandableListView.setAdapter(adapter); | |
setExpandableListViewHeight(expandableListView, -1); | |
expandableListView.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() { | |
@Override | |
public boolean onGroupClick(ExpandableListView parent, View v, int position, long id) { | |
setExpandableListViewHeight(parent, position); | |
return false; | |
} | |
}); | |
return view; | |
} |
Perfectly Worked.
awesome, thank you!
Why use this line setExpandableListViewHeight(expandableListView, -1); ?
Because when I use this my ExpandabeListView is showing in scroll initially but it set normal when i expanded any item
remains lots of space before click on any group,after clicking everything ok
give me solution
Excelente lo de shobishani , me funciono al 100
I would only add after children loop
totalHeight += (listView.getDividerHeight() * (listAdapter.getChildrenCount(i) - 1));
I used this method on my extendedListView but at first unnecessary extra space remains in my activity. Then I clicked a group, and it fixed. How to fix this problem?
I solved it. You can use it.
https://gist.github.com/zeynep-turker/ee0f5917a4f230a8d1f424efa5834648
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This works really fine below method