[UWP] Windows Universal App适用于资源。

编程入门 行业动态 更新时间:2024-10-27 12:38:52
本文介绍了[UWP] Windows Universal App适用于资源。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

您好,我正在尝试为Windows应用商店部署应用程序。该应用程序有很多纹理文件,字体和我的代码访问和加载的其他自定义的东西。我当前的阻塞是我无法将此资源复制到Myapp / Resources / 类目录,以便我可以检索。

Hello, I am trying to deploy an application, for the windows store. The application, has a lot of texture files, fonts, and other custom things that my code accesses and loads. My current blockage is that I cannot copy this resources to Myapp/Resources/ kind of directory so I can retrieve.

  • 我该如何解决这个问题?
  • 是否支持?
  • 是否有我可以遵循的指南?

提前谢谢!

推荐答案

Hi Michae_P_C,

HiMichae_P_C,

欢迎到开发通用Windows应用论坛! 请使用 标记 当发布到此论坛时,谢谢!

在uwp中,我们可以将文件放在应用程序安装目录中并获取该文件通过以下代码,更多详细信息,您可以看到 文件访问权限。

In uwp, we can put files in theApplication install directory and get the file by the following codes, more details, you can see theFile access permissions.

using Windows.Storage; StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///file.txt"));

此外,我们可以使用XAML为我们的应用定义UI或资源,并从我们的应用中获取,请参阅 ResourceDictionary和XAML资源引用。

Also, we can define the UI or resources for our app using XAML, and get it from our app, please refer to ResourceDictionary and XAML resource references.

此外,我们可以将UI的字符串资源放入资源文件中。然后,您可以从代码或标记中引用这些字符串。请参阅 将 UI字符串放入资源。

Besides, we can put string resources for our UI into resource files. You can then reference those strings from your code or markup. Have a refer toPut UI strings into resources.

祝你好运,

Breeze

更多推荐

[UWP] Windows Universal App适用于资源。

本文发布于:2023-11-06 04:16:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1562691.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:适用于   资源   Windows   UWP   App

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!