SetAlpha for viewing programmatically

In the Android docs, I saw the setAlpha 1 API. I have a view that I am trying to use setAlpha (float) in the view, but the compiler says that such a method does not exist. Did I miss something?

+4
source share
2 answers

As far as I can tell, http://developer.android.com/reference/android/view/View.html#setAlpha(float ) is supported only from API level 11 (not 1).

If you want to use this, you need to add something like

<uses-sdk android:minSdkVersion="11"/>

+3
source

Set the presentation background to color using the ARGB scheme.

android:background=#77777777 sets it to a dull translucent gray

This does not work with ListView items, which is an exception.

0
source

Source: https://habr.com/ru/post/1390372/


All Articles