没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Android Drawable XML Documentation
The missing manual! Each of the top
-
level elements are useable in Android XML files, in /res/drawable/. Some of them are
allowed to be contained in others and this is noted below.
<animated-rotate>
A Drawable that can animate a rotation of another Drawable.
Attributes
Element
Class
Description
<animated
-
rotate>
AnimatedRotateDrawable
A Drawable that can animate a rotation of another Drawable.
<animation
-
list>
AnimationDrawable
An object used to create frame
-
by
-
frame animations, defined by a series of Drawable
objects, which can be used as a View object's background.
<bitmap>
BitmapDrawable
A Drawable that wraps a bitmap and can be tiled, stretched, or aligned.
<clip>
ClipDrawable
A Drawable that clips another Drawable based on this Drawable's current level value.
You can control how much the child Drawable gets clipped in width and height based
on the level, as well as a gravity to control where it is placed in its overall container.
Most often used to implement things like progress bars.
<color>
ColorDrawable
A specialized Drawable that fills the Canvas with a specified color, with respect to the
clip region.
<inset>
InsetDrawable
A Drawable that insets another Drawable by a specified distance. This is used when a
View needs a background that is smaller than the View's actual bounds.
<layer
-
list>
LayerDrawable
A Drawable that manages an array of other Drawables. These are drawn in array
order.
<level
-
list>
LevelListDrawable
A resource that manages a number of alternate Drawables, each assigned a maximum
numerical value.
<nine
-
patch>
NinePatchDrawable
A resizeable bitmap, with stretchable areas that you define.
<rotate>
RotateDrawable
A Drawable that can rotate another Drawable based on the current level value. The
start and end angles of rotation can be controlled to map any circular arc to the level
values range.
<scale>
ScaleDrawable
A Drawable that changes the size of another Drawable based on its current level
value.
<selector>
StateListDrawable
Lets you assign a number of graphic images to a single Drawable and swap out the
visible item based on state.
<shape>
GradientDrawable
Basic method for drawing shapes via XML.
<transition>
TransitionDrawable
An extension of <layer
-
list> that is intended to cross
-
fade between the first and
second layer. The format is exactly the same as <layer
-
list>.
Name
Type
Default
Description
visible
boolean
parent|true
Determines if drawable is visible.
frameDuration
integer
150
The duration of each frame, in milliseconds.
framesCount
integer
12
Number of frames of rotation to animate.
pivotX
float|fraction
.5
The pivot point, as a fraction of the width.
pivotY
float|fraction
.5
The pivot point, as a fraction of the height.
drawable
reference
null
The drawable to use for this item. Either this must be present or a drawable
subelement must exist.
Generated by www.PDFonFly.com at 1/15/2011 1:58:30 AM
URL: http://idunnolol.com/android/drawables.html
Children
<[any drawable tag]>
Any drawable xml. Either this must be present or the 'drawable' attribute must be set.
<animation-list>
An object used to create frame
-
by
-
frame animations, defined by a series of Drawable objects, which can be used as a
View object's background.
Attributes
Children
<item>
A drawable for a frame of animation.
Attributes
Children
<[any drawable tag]>
Element
Description
<[any drawable tag]>
Any drawable xml. Either this must be present or the 'drawable' attribute must be set.
Name
Type
Default
Description
visible
boolean
parent|true
Determines if drawable is visible.
variablePadding
boolean
false
If true, allows the drawable's padding to change based on the current state that is
selected.
oneshot
boolean
false
If true, the animation will only run a single time and then stop.
Element
Description
<item>
A drawable for a frame of animation.
Name
Type
Default
Description
drawable
reference
null
The drawable to use for this item.
Either this must be present or a drawable
subelement must exist.
duration
integer
-1
The duration of this frame, in milliseconds. Required.
Element
Description
<[any drawable tag]>
Any drawable xml. Either this must be present or the 'drawable' attribute must be set.
Generated by www.PDFonFly.com at 1/15/2011 1:58:30 AM
URL: http://idunnolol.com/android/drawables.html
Any drawable xml. Either this must be present or the 'drawable' attribute must be set.
<bitmap>
A Drawable that wraps a bitmap and can be tiled, stretched, or aligned.
Attributes
<clip>
A Drawable that clips another Drawable based on this Drawable's current level value. You can control how much the child
Drawable gets clipped in width and height based on the level, as well as a gravity to control where it is placed in its overall
container. Most often used to implement things like progress bars.
Attributes
Children
Name
Type
Default
Description
src
reference
N/A
The source for the Bitmap. Required.
antialias
boolean
false
Enables or disables antialiasing.
filter
boolean
true
Enables or disables bitmap filtering. Filtering is used when the
bitmap is shrunk or stretched to smooth its apperance.
dither
boolean
true
Enables or disables dithering of the bitmap if the bitmap does not
have the same pixel configuration as the screen (for instance: a
ARGB 8888 bitmap with an RGB 565 screen).
gravity
enum (top, bottom, left, right,
center_vertical, fill_vertical,
center_horizontal, fill_horizontal,
center, fill, clip_vertical,
clip_horizontal)
fill
Defines the gravity for the bitmap. The gravity indicates where to
position the drawable in its container if the bitmap is smaller than
the container.
tileMode
enum (disabled, clamp, repeat,
mirror)
disabled
Defines the tile mode. When the tile mode is enabled, the bitmap
is repeated. Gravity is ignored when the tile mode is enabled.
Values can be 'clamp' (replicates the edge color), 'repeat' (repeats
the bitmap in both directions), 'mirror' (repeats the shader's image
horizontally and vertically, alternating mirror images so that
adjacent images always seam).
Name
Type
Default
Description
clipOrientation
enum (horizontal, vertical)
horizontal
The orientation for the clip.
gravity
enum (top, bottom, left, right, center_vertical,
fill_vertical, center_horizontal, fill_horizontal, center,
fill, clip_vertical, clip_horizontal)
left
Specifies where to clip within the
drawable.
drawable
reference
null
The drawable to use for this item. Either
this must be present or a drawable
subelement must exist.
Element
Description
Generated by www.PDFonFly.com at 1/15/2011 1:58:30 AM
URL: http://idunnolol.com/android/drawables.html
剩余10页未读,继续阅读
幻影浪子
- 粉丝: 6017
- 资源: 20
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页