1

Is there any recommendation on how big each cell has to be in terms of dp in a listview. (Assume a list view with just one line of text)?

Thanks,
Teja

Tejaswi Yerukalapudi
  • 8,987
  • 12
  • 60
  • 101

3 Answers3

5

if "how big each cell" means row height then

android:layout_height="?android:attr/listPreferredItemHeight"

should help

Selvin
  • 6,598
  • 3
  • 37
  • 43
4

Addition to Selvin's answer.

If you want it from source code:

R.attr.listPreferredItemHeight
balazsbalazs
  • 4,071
  • 1
  • 24
  • 29
0

Via Code:

R.attr.listPreferredItemHeight is only the resource id and not the value.

this works: Android: how to get value of "listPreferredItemHeight" attribute in code?

Community
  • 1
  • 1
Diego Frehner
  • 2,396
  • 1
  • 28
  • 35