Android equivalent to iphone indexed UITableView

后端 未结 3 1268
执笔经年
执笔经年 2020-12-18 07:06

I am porting an iPhone app over to the Android platform. One of the views has a very large list of data and on the iPhone app, there\'s a scrollbar of sorts on the right han

3条回答
  •  感情败类
    2020-12-18 07:35

    The Android way to do this is to make the list filterable using the keyboard, like a Blackberry. You should do it this way to fit in with the platform experience.

    To implement this, you call the setTextFilterEnabled(boolean textFilterEnabled) method on your list view. See example below:

    myListView.setTextFilterEnabled(true);
    

    For a complete example, see Hello, ListView.


    If you can't use that, then you can use the fast scrolling like seen in the Contacts application. This is not a public API yet, but you can implement it from the Contacts source code at https://android.googlesource.com/platform/packages/apps/Contacts .

提交回复
热议问题