When I try to set spinner popup background, following code works;
setPopupBackgroundResource(R.drawable.black);
But I need to set hex code dynamically as popup background and uses following code.But it doesn't work for me
spinner.setPopupBackgroundResource(#FF5733)
Thanks in advance...:)
You want to use setPopupBackgroundDrawable()
like this:
spinner.setPopupBackgroundDrawable(ColorDrawable(0xFF5733));
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.