I have a Xamarin Forms (2.0) Android app where I'm trying to show an image. I've got an icon called icon-pages-r1.png
which I'm trying to show using the following code:
<Image Source="icon-pages-r1.png" />
The image isn't showing though. When I change the source to Icon.png
(the default Xamarin icon) it does work.
The image is a semi-transparent PNG (thus a colored icon in the middle and transparent around it), it's 46x46 and in Windows it shows fine as item type PNG File. I tried opening the image in Paint and re-saving it (which kills the transparency) but that doesn't work either. The Build Action
for the images are AndroidResource
with Copy to Output Directory
set to Do not copy
.
Does anyone know why I can't get this image to show in my app?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…