Android ExpandableListView Scroll to Expanded Group Position
Once I had this problem: I had an ExapandableListView with groups and children. When I wanted to expand a group the list was scrolling to the end every time. After a little search I’ve figured it out what the problem was. In my xml file where my ExpandableListView was created, I had this attribute:
So I changed it to this:
And the problem was solved. When I expanded a group from the ExpandableListView, the list was scrolling to the group I had expanded.
So if it happens to you to have this problem too, please consider this solution even if you don’t have the transriptMode attribute, just put it in your xml code as disabled, it might work for you too 🙂
Search In Blog
Want to donate?
Recent Posts: My Android Solutions
If you ever wondered how to read and parse a simple JSON file stored in the assets directory of your Android project, here is a way to do it.
In this tutorial I will create a simple Sectioned RecyclerView that will show 2 sections and a few items in each section and how to move an item from one section to another. Note: For RecyclerView I used AndroidX imports and not android.support.v7.widget.RecyclerView! Setup We need to import the recycler view from AndroidX. The build.gradle…
Recently, I had to add a perfect square CardView and I wanted to achieve this without hardcoding its width and height. I happily discovered the power of ConstraintLayout and this is how I managed to create a perfect square which should work on every dimension. In my project I created a RecyclerView with 2 columns,…