Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

设置背景颜色的值在as不方便查看 #5

Open
YumikoAzu opened this issue Jan 1, 2021 · 1 comment
Open

设置背景颜色的值在as不方便查看 #5

YumikoAzu opened this issue Jan 1, 2021 · 1 comment

Comments

@YumikoAzu
Copy link

inline var View.background_color: String
get() {
return ""
}
set(value) {
setBackgroundColor(Color.parseColor(value))
}
background_color = "#eeeeee" as左侧没有颜色值显示
改成这样 as在左侧能看到是啥颜色
inline var View.background_color: Int
get() {
return 0
}
set(value) {
setBackgroundColor(ContextCompat.getColor(this.context,value))
}
background_color = R.color.colorAccent

@wisdomtl
Copy link
Owner

nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants