与WhatsApp的新UI一样,其中相机图标(第一个标签)的宽度较小,而所有其他3个标签的宽度相同。我们如何在标签布局中实现相同的目标?
答案 0 :(得分:1)
您可以为选项卡创建自定义布局,并根据需要设置维度 并扩充该布局并使用此膨胀布局设置自定义视图方法
View customView = LayoutInflater.from(getContext()).inflate(R.layout.custom_layout, null);
Tab tab=new TabLayout.Tab()
tab.setCustomView(customView)
mLayout.addTab(tab)