开发者

draw a list with sections in android

开发者 https://www.devze.com 2023-03-04 18:26 出处:网络
i have to draw a listview with sections. To be precise i have to display events in the different months of the year. In this the month name becomes the header of the section and the event in that mont

i have to draw a listview with sections. To be precise i have to display events in the different months of the year. In this the month name becomes the header of the section and the event in that month become the data inside the section.

i am currently getting data in a hashmap, with the month name as the key and an array on events in that month as an object.

how do i achieve this effect? In iphone app development i believe there is a inbuilt functionality for this, is there such a provision in android?

thank you in advance.

NOTE: why can't i use a TableView inside a ScrollView to do the above? There is no need to go through adapters and all when i can do this. The process should b开发者_开发百科ecome very less complex.


Due to the lack of built-in support for sectional header lists, we have to deal with section-header and caption views separably, where sectional-header should be non-clickable and should not be counted as a ListView child. For this you have to override some methods like getView, getCount etc of an efficient adapter.

Search separatedListAdapter for more references.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号