Gets the background color of the control Andrews

private fun getBackgroundColor(): Int {
    var bgColor = Color.parseColor("#000000")
    if (backgroundColorTv.background is ColorDrawable) {
        val colorDrawable = backgroundColorTv.background as ColorDrawable
        bgColor = colorDrawable.color
    }
    return bgColor
}
Published 390 original articles · won praise 65 · views 340 000 +

Guess you like

Origin blog.csdn.net/yinxing2008/article/details/104049743