Hello to all. I do vertical scrolling. In it I have foliage and a couple more buttons. But for some reason the height of the leaves is equal to one result, although there are more items in it. If you specify the height in dp, then everything is fine, if fill_parent
, then the height is wrong.
- Do you have a ListView accidentally lying in a ScrollView? - falstaf
- Yes, in ScrollView. ListView should have no scrolling at all. - zimper
|
1 answer
Open the ScrollView documentation, and see what is written in black and white:
You should never use a ScrollView with a ListView , because the ListView doesn’t care.
Simply put, never put something that has its own vertical scrolling in a ScrollView .
- I'm wondering, does anyone even open the documentation? - Roman Zakharov
- that is, it is generally impossible to think of anything? if you disable scrolling in ListView? - zimper
- then can i hear the analogue of a listview? which can also be tagged, but it will not have a scroll. - zimper
- oneI will build you a ListView in ScrollView so you can scroll when you scroll! - Sevak Avetisyan
- oneBring all these your "other components, buttons, security bars, textbooks" into a separate layout, get it View via LayoutInflater.inflate, then add it to your ListView via addHeaderView or addFooterView. - falstaf
|