4

I saw in the Android documents there is a setAlpha API Level 1.I have a View that I try to use setAlpha(float) on the view, but the compiler says no such method exists. Am I missing something?

prostock
  • 9,327
  • 19
  • 70
  • 118

2 Answers2

3

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

If you want to use this, you'll have to add to your Manifest something like

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

Marc Van Daele
  • 2,856
  • 1
  • 26
  • 52
0

Set the background of the view to a color using the ARGB scheme.

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

This doesn't work in the case of ListView items, which is an exception.

Vikram Bodicherla
  • 7,133
  • 4
  • 28
  • 34