Define list view with static elements on android in xml?

后端 未结 4 1927
傲寒
傲寒 2021-02-05 00:54

I want to create fragment which would display static menu as a set of rows in a list.

I like iOS method with static cells in a tableview. How can I achieve this in andro

4条回答
  •  我在风中等你
    2021-02-05 01:18

    You can use a vertical LinearLayout nested within a ScrollView to get what you're looking for. Put your "listview" items inside the LinearLayout, and style them to look like elements of a listview.

    If you absolutely must use a ListView (e.g. you're using ListFragment), you'll have to use a ListAdapter subclass or roll your own.

提交回复
热议问题