制御アンドリュースの背景色を取得します。

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
}
公開された390元の記事 ウォン称賛65 ビュー340 000 +

おすすめ

転載: blog.csdn.net/yinxing2008/article/details/104049743