【问题标题】:BackgroundImage() in Xamarin for cross platform mobile design not workingXamarin 中的 BackgroundImage() 用于跨平台移动设计不起作用
【发布时间】:2018-06-21 18:37:02
【问题描述】:

系统:Windows 10、Visual Studios、Xamarin、跨平台移动设计、iPhone X 上的 Xamarin Live 应用。

在我的 MainPage.xaml 文件中,我添加了以下代码:

BackgroundImage="Users\Zakariah Siyaji\Desktop\3840X2160-HDR-Wallpaper-1.jpg"

没有这一行,我的代码可以正确编译和运行。使用这行代码,我不会收到错误;事实上,输出窗口显示:“部署到 iPhone 播放器成功。”但是,Xamarin Live 应用程序在 iPhone X 上崩溃。我无法在轮播页面上显示背景图像。有没有我缺少的修复程序?我需要额外的代码吗?

【问题讨论】:

标签: c# xaml xamarin.forms xamarin.ios xamarin.android


【解决方案1】:

您无法从手机访问本地电脑文件, 如果您需要背景图像,则将其添加到 android 的 drawable 和 ios 将其添加到 Resources 文件夹下的 assets 文件夹中。 稍后您可以使用它访问它

BackgroundImage="image.png";

【讨论】:

    【解决方案2】:

    您的手机无法访问您的计算机文件系统。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多