2

I'm working on an Android application in Xamarin. For button backgrounds, I've created a simple XML. The code is:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
    <shape android:shape="oval">
        <gradient   android:startColor="#ff000000" 
                    android:centerColor="#ffffffff" 
                    android:endColor="#00ffffff" 
                    android:type="radial" 
                    android:gradientRadius="100" 
                    />
    </shape>
</item>
</selector> 

When I use linear or sweep in android:type code, everything is fine. A good transparent gradient appear in my device (My device is HTC One M8). But when I use radial, a bad solid color appears, no transparency. I want to use this technique for the shadow under buttons, but if you check the screenshot below, a very bad harshy solid color appear under the buttons.

If the code uses RGB or ARGB color, it draws a buggy solid gradient!

Is it a bug in the code, in my device or in the Xamarin deploy setting?

ScreenShot of the Bug

Nisse Engström
  • 4,738
  • 23
  • 27
  • 42
eager
  • 308
  • 2
  • 11

0 Answers0