Google 致力于为黑人社区推动种族平等。查看具体举措

TabLayoutMediator.TabConfigurationStrategy

public static interface TabLayoutMediator.TabConfigurationStrategy

com.google.android.material.tabs.TabLayoutMediator.TabConfigurationStrategy


A callback interface that must be implemented to set the text and styling of newly created tabs.

Summary

Public methods

abstract void onConfigureTab(TabLayout.Tab tab, int position)

Called to configure the tab for the page at the specified position.

Public methods

onConfigureTab

void onConfigureTab (TabLayout.Tab tab, 
                int position)

Called to configure the tab for the page at the specified position. Typically calls setText(CharSequence), but any form of styling can be applied.

Parameters
tab TabLayout.Tab: The Tab which should be configured to represent the title of the item at the given position in the data set.

position int: The position of the item within the adapter's data set.