TextView getColor

Eungi KimΒ·2020λ…„ 11μ›” 17일
0

ν˜„μž¬ ν…μŠ€νŠΈ 뷰의 textColor λ₯Ό 톡해 μƒνƒœλ₯Ό ν™•μΈν•˜λŠ” κΈ°λŠ₯을 κ΅¬ν˜„ν•˜λ˜ 쀑 getTextColor λ©”μ„œλ“œλŠ” ColorStateList 클래슀λ₯Ό λ¦¬ν„΄ν•œλ‹€. ν•΄λ‹Ή 클래슀λ₯Ό μ‚¬μš©ν•˜λŠ”κ²ƒλ³΄λ‹€ 더 κ°„λ‹¨ν•˜κ²Œ getCurrentTextColor λ©”μ„œλ“œλ₯Ό μ‚¬μš©ν•΄μ„œ int κ°’μœΌλ‘œ 리턴할 수 μžˆλ‹€.

int color = mTextView.getCurrentTextColor();
String hexColor = String.format("#%06X", (0xFFFFFF & color));
profile
Run and gun and debugun

0개의 λŒ“κΈ€