Is it possible to extend AbsListView to make new ListView implementations?

后端 未结 2 572
情深已故
情深已故 2021-02-03 17:24

I\'ve been looking at creating a stylistically different list view, like many other people, and I started by looking to extend AbsListView. Per the Android doc, AbsListView is:<

2条回答
  •  感动是毒
    2021-02-03 18:01

    I've had the same experience trying to subclass ListView and AbsListView to develop a 2D scrollable spreadsheet. I ended up with my own subclass of ViewGroup which handles layout and a subclass of TwoDScrollView to handle the scrolling. The hardest parts are getting flings to work correctly (ie. create and place new views before they scroll into view) and synchronizing view positions between scrollable components. With enough time though, it is possible to create a robust component that pulls data from a Cursor and scrolls it around quite smoothly and quickly.

提交回复
热议问题