How to fix the icon size of an Expandablelistview?

Asked

Viewed 33 times

1

I’m using a Expandablelistview, where I have a content expansion icon, but every time I increase the height of the option, the image gets the same height, distorting the image. How do I fix the size?

In class I make the following call to xml:

expandableListView.setGroupIndicator(getResources(). getDrawable(R.drawable.icon_group));

XML:

xml icon_group

Final result:

inserir a descrição da imagem aqui

  • 1

    Could post the xml layout of that item?

  • I entered the xml in the question, Wakim.

  • So... I never used the ExpandableListView in minutiae, but the vast majority of problems with this distortion are solved using a 9-patch instead of a simple Asset. Basically it would be to create a 9-patch this icon with each tip having 1 transparent pixel to resize, so you can keep the opaque part of the icon intact. To generate the 9-patch, I recommend this site: https://romannurik.github.io/AndroidAssetStudio/nine-patches.html

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.