Highlight selected item?

2 posts, 0 answers
  1. Dimitris
    Dimitris avatar
    5 posts
    Member since:
    Nov 2015

    Posted 19 Apr Link to this post


    I'm using a RadListView with the WrapLayoutManager and have added a selectionlistener. I've also changed the selectionbehavior by adding:



    What I didn't manage to do is to highlight the selected item of the list. I've read the documentation here(http://docs.telerik.com/devtools/android/controls/listview/behaviors/listview-behaviors-selection), but didn't work.

    What should I do to get the selected item highlighted?

    Thanks in advance

  2. Todor
    Todor avatar
    775 posts

    Posted 22 Apr Link to this post

    Hello Dimitris,

    Thank you for your question.

    If you are using the default ListViewAdapter, the items should be selectable as soon as you add the behavior to the list view:


    If you are using a custom adapter with a custom template, you need to make sure your layout contains a StateListDrawable with a selectable state as shown here. If you don't need a special state list drawable, you can use the one we have provided as it is shown in this documentation article (the state list drawable that you can use is '@drawable/selectable_item_background' and should be used as a background of some visible view from the item layout that you use).

    If your issue persists, please provide more information about your scenario and how we can reproduce it.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
Back to Top