줄바꿈1 [andorid] TextView 줄바꿈 변경 (Activity 전체) TextView는 개행 기준이 어절이여서 음절로 바꾸기 위해 replace(" ", "\u00A0")가 필요하다. Activity내에 모든 TextView를 바꾸기 위해선 rootView를 돌려서 찾아주면 끝. try { viewDataBinding.run { (root as ViewGroup).allViews.forEach { if (it is TextView) { it.text = it.text.toString().replace(" ", "\u00A0") } } } } catch (e: Exception) { e.printStackTrace() } 2023. 12. 13. 이전 1 다음