如何使viewPager的标签充当微调?

问题描述 投票:0回答:1

我在我的应用程序视图寻呼机。我需要的标签,而不是仅为文字和图片是一个微调。我没有找到任何教程,我需要知道我怎么可以实现

android android-viewpager android-tablayout
1个回答
1
投票

您必须创建一个tablayout和设置自定义布局(含微调视图)像这样每个标签项:

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);

© www.soinside.com 2019 - 2024. All rights reserved.