How to adjust image button transparency programmatically in android? I create dynamic image buttons on the fly.
You can change the button with the following:
btnMybutton.getBackground().setAlpha(45);
ImageButton.setBackgroundColor (Color.TRANSPARENT) . Should solve the problem.
From http://developer.android.com/reference/android/view/View.html#setBackgroundColor%28int%29
Set the background for this Drawable or remove the background. If the background has padding, this view add-on is set to the background add-on. However, when the background is removed, this Layout View is not affected. If padding is required, use setPadding (int, int, int, int).
I like it:
imageButton.setImageAlpha(alpha_value); //alpha_value between 0...255
Source: https://habr.com/ru/post/1379381/More articles:Text based jQuery change table cell text color - jqueryHow to run multiple linear regression using a vector as my predictors? - rC # WinForm - how to request credentials in a dialog form? - c #Keep only keywords for a domain? - pythonDevelop: user belongs to organization - ruby-on-railsCan I move DOMElement while maintaining focus? - javascriptHow to compile c #? - c #Java threading chain - javaWhy does ColdFusion consider the value “7+” to be a valid integer value and how can I confirm that it is not? - coldfusionSet the maximum height of the css drop-down menu. - cssAll Articles