0

I was trying to apply shadow effect for my views and find out that I could use gradient to do it.

I created an XML file

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <gradient 
        android:endColor="@android:color/transparent"
        android:centerColor="@android:color/transparent"
        android:startColor="@android:color/black"
        android:angle="135"/>
</shape>

This works fine, but I needed to make it more like a shadow. What I need is to remove the transition effect in gradient because I only need two colors in one view applied diagonally. How to do it?enter image description here

P-RAD
  • 1,293
  • 2
  • 15
  • 36

2 Answers2

0

If you want that to be something like tha background of your views, why don't you just save a B/W .jpeg or .png image inside your Drawables and use it when needed specifying its dimensions and alpha (opacity) parameter?

alvaro.delaserna
  • 539
  • 1
  • 6
  • 21
0

In that case I'd suggest using nine-patch drawables

Toochka
  • 894
  • 1
  • 9
  • 25