您的位置:首页 > 移动开发 > Android开发

Resource Types

2016-04-04 20:15 507 查看
Each of the documents in this section describe the usage, format and syntax for a certain type of application resource that you can provide in your resources directory (
res/
).

Here's a brief summary of each resource type:

Animation ResourcesDefine pre-determined animations.

Tween animations are saved in 
res/anim/
 and accessed from the 
R.anim
 class.

Frame animations are saved in 
res/drawable/
 and accessed from the 
R.drawable
 class.Color State List ResourceDefine a color resources that changes based on the View state.

Saved in 
res/color/
 and accessed from the 
R.color
 class.Drawable ResourcesDefine various graphics with bitmaps or XML.

Saved in 
res/drawable/
 and accessed from the 
R.drawable
 class.Layout ResourceDefine the layout for your application UI.

Saved in 
res/layout/
 and accessed from the 
R.layout
 class.Menu ResourceDefine the contents of your application menus.

Saved in 
res/menu/
 and accessed from the 
R.menu
 class.String ResourcesDefine strings, string arrays, and plurals (and include string formatting and styling).

Saved in 
res/values/
 and accessed from the 
R.string
R.array
, and 
R.plurals
 classes.Style ResourceDefine the look and format for UI elements.

Saved in 
res/values/
 and accessed from the 
R.style
 class.More Resource TypesDefine values such as booleans, integers, dimensions, colors, and other arrays.
Saved in 
res/values/
 but each accessed from unique 
R
 sub-classes (such as 
R.bool
R.integer
,
R.dimen
, etc.).

每一本节中的文件描述了某些类型的应用程序资源,你可以在你的资源目录(提供使用,格式和语法
RES /
)。
这里的每个资源类型的简短摘要:
动画资源定义预先确定的动画。

吐温的动画保存在
RES /动画/
从访问
R.anim
类。

帧动画保存在
RES /绘制/
从访问
R.drawable
类。颜色状态列表资源定义变化基于视图状态下显色的资源。

保存在
RES /彩色/
从访问
R.color
类。绘图资源定义各种图形与位图或XML。

在保存
RES /绘制/
从访问
R.drawable
类。资源布局为应用程序定义的UI布局。

保存在
RES /布局/
从访问
R.layout
类。菜单资源定义你的应用程序菜单中的内容。

保存在
RES /菜单/
,并从访问
R.menu
类。字符串资源定义字符串,字符串数组和复数形式(并包含字符串格式化和样式)。

在保存
RES /价值/
从访问
R.string
R.array
R.plurals
类。样式资源定义UI元素的外观和格式

保存在
RES /价值/
从访问
R.style
类。更多资源类型定义值,如布尔,整数,尺寸,颜色和其他数组。

在保存
RES /价值/
但每个从独特的访问
- [R
子类(如
R.bool
R.integer
R.dimen
等)。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息