Answers for "customize android tablayout"

0

customize android tablayout

TabLayoutMediator(your_tab, your_viewPager2) { tab, position ->
     val tabView = LayoutInflater.from(this.context).inflate(R.layout.custom_view, tab_layout, false)
            when (position) {
                0 -> {
                    // you can set your tab text and color here for tab1
                }
                1 -> {
                    // you can set your tab text and color here for tab2
                }
                2 -> {
                    // you can set your tab text and color here for tab3
                }   
            }
}
Posted by: Guest on August-25-2021

Code answers related to "customize android tablayout"

Browse Popular Code Answers by Language