Mostafa Khaled
Mostafa Khaled

Reputation: 372

How to make the tabs of viewPager to act as spinner?

I have a view pager in my app .I need the tab instead of being only text and image to be a spinner. I didn't find any tutorial about that and I need to know how can I implement that

Upvotes: 0

Views: 76

Answers (1)

hamid khakzad
hamid khakzad

Reputation: 11

You must create a tablayout and set custom layout(contain spinner view) for each tab item like this:

tabLayout.getTabAt(0).setCustomView(R.layout.aquablue); tabLayout.getTabAt(1).setCustomView(R.layout.orangeprocess); tabLayout.getTabAt(2).setCustomView(R.layout.shipping); tabLayout.getTabAt(3).setCustomView(R.layout.deliver); tabLayout.getTabAt(4).setCustomView(R.layout.completedtxt); tabLayout.getTabAt(5).setCustomView(R.layout.cancelled);

Upvotes: 1

Related Questions