Tizen Mobile 中的图像不可见
Image in Tizen Mobile is not visible
我在 Visual Studio 2017 中使用 Xamarin 形式的 <Image Source="flower.png" />
代码在 Tizen Mobile 中显示图像,但它没有显示。我将图像文件放在 Tizen 项目的 shared\res 文件夹中。
将图像复制到“.TizenMobile”项目 'res' 目录中(不在 'shared>res' 中,仅在 'res'(root)中)。然后在解决方案 Explorer:Right 中单击 'res' 文件夹并添加 > 现有项目 > png 图像
在您的 ProjectCode(便携式)C# 文件中:
MainPage = new ContentPage
{
Content = new StackLayout
{
VerticalOptions = LayoutOptions.Center,
Children = {
new Image {
Aspect = Aspect.AspectFit,
Source = ImageSource.FromFile("flower.png")
}
}
}
};
或者您甚至可以尝试 XAML。
我在 Visual Studio 2017 中使用 Xamarin 形式的 <Image Source="flower.png" />
代码在 Tizen Mobile 中显示图像,但它没有显示。我将图像文件放在 Tizen 项目的 shared\res 文件夹中。
将图像复制到“.TizenMobile”项目 'res' 目录中(不在 'shared>res' 中,仅在 'res'(root)中)。然后在解决方案 Explorer:Right 中单击 'res' 文件夹并添加 > 现有项目 > png 图像
在您的 ProjectCode(便携式)C# 文件中:
MainPage = new ContentPage
{
Content = new StackLayout
{
VerticalOptions = LayoutOptions.Center,
Children = {
new Image {
Aspect = Aspect.AspectFit,
Source = ImageSource.FromFile("flower.png")
}
}
}
};
或者您甚至可以尝试 XAML。