TextView2 [android] TextView 줄바꿈2 - justificationMode TextView에서 양끝 정렬을 활용하기위해 justificationMode 사용했지만 어절간 간격이 너무 벌어지는 현상이 종종 발견되어 사용하기 어려웠다. 해결방법으로 좋은 커스텀뷰를 찾아 기록 및 공유하고자 글을 남긴다. https://stackoverflow.com/questions/57139782/how-to-fix-cutoff-big-text-when-i-using-custom-textview-to-justify-text 2024. 1. 17. [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 다음