Images, layout descriptions, binary blobs and string dictionaries can be included
in your application as resource files. Various Android APIs are designed to
operate on the resource IDs instead of dealing with images, strings or binary blobs
directly.
For example, a sample Android app that contains a user interface layout (main.xml),
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
would keep its resources in the "Resources" directory of the application:
Resources/
drawable-hdpi/
icon.png
drawable-ldpi/
icon.png
drawable-mdpi/
icon.png
layout/
main.xml
values/
strings.xml
In order to get the build system to recognize Android resources, set the build action to
"AndroidResource". The native Android APIs do not operate directly with filenames, but
instead operate on resource IDs. When you compile an Android application that uses resources,
the build system will package the resources for distribution and generate a class called
"Resource" that contains the tokens for each one of the resources included. For example,
for the above Resources layout, this is what the Resource class would expose:
public class Resource {
public class drawable {
public const int icon = 0x123;
}
public class layout {
public const int main = 0x456;
}
public class strings {
public const int first_string = 0xabc;
public const int second_string = 0xbcd;
}
}
You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
string in the dictionary file values/strings.xml.
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
SpinnerExample Mono安卓例子 (140个子文件)
GalleryDemo.GalleryDemo-Signed.apk 520KB
SpinnerExample.SpinnerExample-Signed.apk 520KB
GalleryDemo.GalleryDemo.apk 515KB
GalleryDemo.GalleryDemo.apk 515KB
SpinnerExample.SpinnerExample.apk 515KB
SpinnerExample.SpinnerExample.apk 515KB
Default.aspx 515B
Main.axml 550B
Main.axml 529B
DesignTimeResolveAssemblyReferencesInput.cache 7KB
DesignTimeResolveAssemblyReferencesInput.cache 6KB
DesignTimeResolveAssemblyReferencesInput.cache 6KB
DesignTimeResolveAssemblyReferences.cache 3KB
MonoRuntimeProvider.class 3KB
MonoRuntimeProvider.class 3KB
MonoPackageManager.class 2KB
MonoPackageManager.class 2KB
ImageAdapter.class 2KB
Activity1.class 1KB
Activity1.class 1KB
Seppuku.class 814B
Seppuku.class 814B
MonoPackageManager_Resources.class 538B
MonoPackageManager_Resources.class 535B
R.class 530B
R.class 494B
R$string.class 378B
R$string.class 366B
R$id.class 356B
R$id.class 355B
R$drawable.class 342B
R$layout.class 338B
R$drawable.class 330B
R$layout.class 326B
R$attr.class 286B
R$attr.class 274B
machine.config 27KB
machine.config 27KB
Web.config 7KB
Web.Release.config 1KB
Web.Debug.config 1KB
Activity1.cs 4KB
ImageAdapter.cs 2KB
Resource.Designer.cs 2KB
Resource.Designer.cs 2KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
Activity1.cs 896B
Default.aspx.designer.cs 811B
Default.aspx.cs 337B
TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs 0B
TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs 0B
TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs 0B
TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs 0B
TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs 0B
TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs 0B
WebApplication1.csproj 4KB
SpinnerExample.csproj 3KB
GalleryDemo.csproj 3KB
classes.dex 158KB
classes.dex 156KB
Mono.Android.dll 9.49MB
Mono.Android.dll 9.49MB
mscorlib.dll 2.61MB
mscorlib.dll 2.61MB
System.Xml.dll 1.18MB
System.Xml.dll 1.18MB
System.dll 1.08MB
System.dll 1.08MB
System.Core.dll 700KB
System.Core.dll 700KB
Mono.Security.dll 290KB
Mono.Security.dll 290KB
GalleryDemo.dll 7KB
GalleryDemo.dll 7KB
GalleryDemo.dll 7KB
SpinnerExample.dll 6KB
SpinnerExample.dll 6KB
SpinnerExample.dll 6KB
R.cs.flag 0B
R.cs.flag 0B
mono.android.jar 131KB
mono.android.jar 131KB
ImageAdapter.java 2KB
MonoRuntimeProvider.java 2KB
MonoRuntimeProvider.java 2KB
MonoPackageManager.java 2KB
MonoPackageManager.java 2KB
Activity1.java 1KB
Activity1.java 1KB
R.java 804B
R.java 804B
R.java 799B
R.java 799B
Seppuku.java 517B
Seppuku.java 517B
jquery-1.4.1-vsdoc.js 234KB
jquery-1.4.1.js 165KB
jquery-1.4.1.min.js 70KB
共 140 条
- 1
- 2
资源评论
- wufeng_aaa2014-07-31好不错,凑合用着
- wjscxq2014-04-23还不错,初学者参考学习
- wizard12016-07-22很好的资源、大家都踊跃共享哦 一起把C#跨平台搞起来
- TNT_19932016-08-03初学者参考学习
- linchangjie2014-07-08这个不错。很有帮助。本来这种资料就少
卿月晟
- 粉丝: 1
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功