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?
Asked
Active
Viewed 74 times
1 Answers
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.

Abdus Sattar Nishad
- 135
- 2
- 9
-
max_height is not working here. Just pitting wrap_content worked for me. – Vikas Pandey Oct 18 '22 at 08:39