管理應用程式資源Managing app resources

應用程式資源檔案 (例如影像、文字檔案和音訊檔案) 是應用程式所需的項目,但不會與應用程式一起編譯。App resource files, such as images, text files, and audio files are necessary to your application, but aren't compiled with the application. Visual Studio for Mac 所支援的每個平台都會以不同的方式處理這些資源,如下列指南中所述:Each platform supported by Visual Studio for Mac handles these resources in different ways, as explained in the following guides:

Xamarin.FormsXamarin.Forms

Xamarin.Forms 程式碼可在多個平台上執行;每個平台都有屬於自己的檔案系統,且每個檔案系統都會決定讀取和寫入檔案的方式。Xamarin.Forms code runs on multiple platforms - each of which has its own filesystem and each file system dictates how to read and write to files. 在 Xamarin.Forms 中,您可以透過在每個平台上使用原生檔案 API,或是將檔案新增為內嵌資源,來管理應用程式資源。In Xamarin.Forms you can manage app resources by using the native file APIs on each platform, or by adding files as embedded resources.

Xamarin.iOSXamarin.iOS

Xamarin.AndroidXamarin.Android

Xamarin.MacXamarin.Mac