공부방/Android2020. 9. 3. 16:16How to android tabItem textView in tabLayout change text style bold programmatically (안드로이드 tablayout tabItem textview bold처리 코드로 하기)

fun TabLayout.changeTabsFont(selectPosition: Int) { val vg = this.getChildAt(0) as ViewGroup val tabsCount = vg.childCount for (j in 0 until tabsCount) { val vgTab = vg.getChildAt(j) as ViewGroup vgTab.forEachIndexed { index, _ -> val tabViewChild = vgTab.getChildAt(index) if (tabViewChild is TextView) { tabViewChild.setTextBold(j == selectPosition) } } } } 커스텀 폰트 적용하고 싶을시 fun TextView.setTextBo..

image