7
<?xml version="1.0" encoding="utf-8"?>
<bitmap
    android:src="@drawable/ic_action_remove"
    android:alpha="0.4"
    xmlns:android="http://schemas.android.com/apk/res/android">

</bitmap>

This piece of code works well only on android API 21 (lollipop).

Are there any ways to set alpha for drawables in previous versions?

Anggrayudi H
  • 14,977
  • 11
  • 54
  • 87
vkrott
  • 69
  • 2
  • 13

1 Answers1

0

Actually, for a bitmap you could apply the android:alpha property to the ImageView which is containing this picture and it'll mechanically set the alpha to the wanted picture.

To do that refer to this and it'll look like this:

android:alpha="0.5"
Community
  • 1
  • 1
Laurent Meyer
  • 2,766
  • 3
  • 33
  • 57