0

I have ListView to be used in the app widget. The list view has a fixed height of some 140 dp to accommodate 3 items, now when there is only one item to show, there is space left below the item. I want to be able to set the list view like this - set wrap_content and a maximum height. Is this possible?

Vikas Pandey
  • 1,115
  • 1
  • 15
  • 25

1 Answers1

0

when you use fixed height it will always take that height no matter how many items u have. In that case u can use maxHeight and set it to 140 dp.So when u have less item the height will reduce. If u have shared the code and a image it would have been better.