XAML Xamarin透明背景图像未显示为透明(灰色和白色)

bwleehnv  于 2022-12-07  发布在  其他
关注(0)|答案(1)|浏览(207)

I am new to xamarin forms. I am trying to display an image with "Transparent background" (Grey and white) but this is how it show on the application.
I am using PNG file for the picture as I saw the other thread commenting on PNG/JPG files but it did not work.
I also try with opacity and backgroundcolor="Transparent" but it did not work either.
The image is random transparent background image got from google.
Any help is appreciated! Thanks.
Picture of the application

<StackLayout BackgroundColor="OrangeRed">
    <Image Source="icon11.png" Aspect="AspectFit" />
</StackLayout>
7rtdyuoh

7rtdyuoh1#

正如Shaw在评论中提到的,我在透明背景PNG文件上犯了一个错误。
我测试了一个透明的背景xamarin标志从预先建立的xamarin表单页面,它的工作。
我的案例结论:仔细检查图片是否真的有透明背景。
详细信息:
我使用的图片和上面显示的实际上并没有透明的背景,一个可以检查时,从您的电脑打开它(它将显示白色和灰色框)。
Not "Real" Transparent Picture
Actual Transparent Picture

相关问题