53.11 Displaying Icon Tab Items
The last step in this tutorial is to replace the text based tabs with icons. Achieve this by modifying the onCreate() method in the MainActivity.kt file to assign some built-in drawable icons to the tab items:
private fun configureTabLayout() {
binding.tabLayout.addTab(binding.tabLayout.newTab().setIcon(
android.R.drawable.ic_dialog_email))
binding.tabLayout.addTab(binding.tabLayout.newTab().setIcon(
android.R.drawable.ic_dialog_dialer))
binding.tabLayout.addTab(binding.tabLayout.newTab().setIcon(
android.R.drawable.ic_dialog_map))
binding.tabLayout.addTab(binding.tabLayout.newTab().setIcon(
...