Thanks for the answers.
Maybe the problem could really be due to the graphics card (I'm using Windows 10 with the default display adapter because the specific driver Intel UHD Graphics 620 was giving me problems).
However if I create a gradient bitmap with BitmapCreator and then assign the bitmap to an ImageView then it works correctly.