日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Android >内容正文

Android

xamarin android pdf,Xamarin 中的Android资源及使用.pdf

發布時間:2023/12/9 Android 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 xamarin android pdf,Xamarin 中的Android资源及使用.pdf 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Xamarin 中的Android資源及使用

Xamarin 中的Android 資源及使用

本文介紹Xamarin Android 中的Android 資源概念,以及如何使用資源。

討論如何使用資源實現應用程序 地化,多種設備支持如各種屏幕大小

和密度。

This article introduces the concept of Android resources in

Xamarin.Android and will document how to use them. It covers how to use

resources in your Android application to support application localization,

and multiple devices including varying screen sizes and densities.

概述Overview

很少有Android 應用程序只包含源碼。通常還有很多組成應用程序的文件:視頻、圖像、音

頻文件等等。總體上說,非源碼文件都是資源,在生成過程和打包APK 的時候與源碼一起

編輯,并同時安裝到設備:

An Android application is seldom just source code. There are often many other files that make up

an application: video, images, and audio files just to name a few. Collectively, these non-source

code files are referred to as resources and are compiled (along with the source code) during the

build process and packaged as an APK for distribution and installation onto devices:

資源為Android 應用程序提供各種優勢:

代碼隔離 將代碼與圖像、字符、菜單、動畫、顏色等隔離開。比如可以方便的 地化。

多設備部署 無需修改代碼就可以簡單的實現不同設備的配置支持。

編譯時檢查 資源是靜態的,可編譯到應用程序中。這樣就可以在編譯的時候檢查資源,修

正錯誤,否則在運行時很難定位和修改錯誤。

當新創建一個Xamarin Android 項目,會創建一個叫做Resources 的目錄,同時還有很多子

目錄:

Resources offer several advantages to an Android application:

Code-Separation - Separates source code from images, strings, menus, animations, colors, etc. As

such resources can help considerably when localizing.

Target multiple devices –Provides simpler support of different device configurations without

code changes.

Compile-time Checking - Resources are static and compiled into the application. This allows the

usage of the resources to be checked at compile time, when it will be easy to catch and correct the

mistakes, as opposed to run-time when it is more difficult to locate and costly to correct.

When a new Xamarin.Android proj ect is started, a special directory called Resources is created,

along with some subdirectories:

上圖所示,應用程序資源按類型組織到各個子目錄中:圖像放在drawable 目錄;控件放在

layout 目錄等等。

在Xamarin Android 應用程序中有兩種方式訪問這些資源:使用代碼或聲明式XML 。

這些資源叫做默認資源可用于所有設備,除非指定了設備匹配

總結

以上是生活随笔為你收集整理的xamarin android pdf,Xamarin 中的Android资源及使用.pdf的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。