Overlay items in Listview

Asked

Viewed 112 times

0

Good morning!

I have an app android implemented in c#. This application displays a "list view" with the products. Each product has information that can be viewed by clicking on the "V" button and hidden to the customer on the "/ " button. Information is displayed/hidden normally when the "list view" has more than 1 item. However, whenever "list view" has only 1 item, the following situation occurs:

I click "V" to display the information:

I click "/ " to hide the information:

When pressing the "/ " button, the "list view" should return to the original state of the list with 1 item. However this "overlay" of information is occurring.

How to ensure that this "overlap" does not happen?

Important remarks:

  • This problem only occurs when the list view has only 1 item.
  • The problem does not always occur, that is, even with the list view displaying 1 item, sometimes information is hidden correctly.

From now on, thank you.

  • This behavior seems to me very much the behavior of Expandablelistview, which is an existing component of Android, where you extend Baseexpandablelistadapter and it already treats this open/close. I found a video explaining how to do it in Xamarin, see if it gives you a light: https://www.youtube.com/watch?v=9k1zVNVMauo

  • @Grupocdsinformática I will look at the video. Thank you.

  • You can post the file with the layout of the Listview item and the complete Adapter code?

  • @Márciooliveira added layout in the description of the question.

  • Its layout is with a very complex hierarchy of views. Difficult to evaluate just by looking at the page here (you would have to copy and paste into an Android Studio project). Why don’t you try using Contraintlayout? You can do everything you did without any Linearlayout (maybe just what you want to hide). I don’t know if it will solve the problem, but it will surely make the layout much cleaner and performative (many nested Linearlayout is not a good one, especially with Weight). I’ll take a slow look later on the PC. If you can, put the full Adapter as well.

No answers

Browser other questions tagged

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