How do we record the height of listView?



  • listView is filled in software and is among the others layout. The root element is ScrollView. Once the list has been demarcated, it has only one line of height, and the rest are available on the list. I've been selling wrap_content and matching_parent, not helping. How do you make the list look all the lines?



  • And ScrollView and ListView are blank elements. If one is placed in another, the candy is scrubbed, the system cannot understand what it should be. And in your particular case, ListView is squeezed to the height of the first element.

    You have two options:

    1. All above ListView To make him Header-om, and all that's below is Footer-m. That's the right way.

    2. Set a fixed height for ListView, predetermining the total height of all its components. It's a hack and a crutch, don't do that.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2