-3

I have an xml file for a custom list item which contains two text fields and an image in a box. How can I show such listview which can be scrollable horizontally showing one list item after each horizontal swipe?

Vikas D
  • 542
  • 1
  • 5
  • 12

1 Answers1

1

How to show a swipeable horizontal list view in android?

A RecyclerView with LinearLayoutManager with HORIZONTAL orientation.

LinearLayoutManager layoutManager
    = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
RecyclerView myList = (RecyclerView) findViewById(R.id.my_recycler_view);
myList.setLayoutManager(layoutManager);  

Source: How to build a Horizontal ListView with RecyclerView?

Update:

showing one list item after each horizontal swipe?

For this you need a ViewPager.

Community
  • 1
  • 1
An SO User
  • 24,612
  • 35
  • 133
  • 221