Android - creating listview entirely from xml

前端 未结 1 476
终归单人心
终归单人心 2021-02-13 23:38

I want to present some choices in my application. Right now I\'m doing it with buttons one under another.

What I really want to do is to present them as a list like in \

相关标签:
1条回答
  • 2021-02-14 00:20

    But how do I add entries to that? All examples I've found do it programatically - through cursor adapters or array adapters.

    Use the android:entries attribute on your ListView element, pointing to a <string-array> resource (typically put in res/values/arrays.xml).

    0 讨论(0)
提交回复
热议问题