- 浏览: 559248 次
- 性别:
- 来自: 广州
文章分类
- 全部博客 (338)
- 已过时文章(留念用) (39)
- Android学习笔记 (30)
- Android开发指引自译 (100)
- Android NDK文档自译 (23)
- Android设计指引自译 (2)
- xp(ペケピー)&linux(理奈、铃)酱~ (4)
- ui酱&歌词自译~ (9)
- lua酱~ (9)
- 自我反省 (1)
- 羽game计划 (1)
- XSL酱 (2)
- java酱 (3)
- 设计的领悟 (58)
- 涂鸦作品(pixiv) (1)
- ruby酱 (2)
- Objective-C编程语言自译 (2)
- Android开发月报 (6)
- objc酱 (2)
- photoshop (3)
- js酱 (6)
- cpp酱 (8)
- antlr酱 (7)
- Lua 5.1参考手册自译 (11)
- 收藏品 (3)
- 待宵草计划 (4)
- 体验版截图 (1)
最新评论
-
naruto60:
太给力了!!!!我这网打不开Intel官网,多亏楼主贴了连接, ...
使用HAXM加速的Android x86模拟器(和一些问题) -
yangyile2011:
谢谢博主,翻译得很好哦
【翻译】(4)片段 -
ggwang:
牙痛的彼岸:痹!
牙痛的彼岸 -
ggwang:
总结得很简练清晰啊,学习了!
ANTLR学习笔记一:概念理解 -
leisurelife1990:
mk sdd
用git下载Android自带app的源代码
【翻译】(76)视图动画
see
http://developer.android.com/guide/topics/graphics/view-animation.html
原文见
http://developer.android.com/guide/topics/graphics/view-animation.html
-------------------------------
View Animation
视图动画
You can use the view animation system to perform tweened animation on Views. Tween animation calculates the animation with information such as the start point, end point, size, rotation, and other common aspects of an animation.
你可以使用视图动画系统以执行View上的补间动画。补间动画使用一些信息诸如开始点、结束点、大小、旋转和一个动画的其它一般方面来计算动画。
A tween animation can perform a series of simple transformations (position, size, rotation, and transparency) on the contents of a View object. So, if you have a TextView object, you can move, rotate, grow, or shrink the text. If it has a background image, the background image will be transformed along with the text. The animation package provides all the classes used in a tween animation.
一个补间动画可以在一个View对象的内容上执行一系列简单变换(位置,大小,旋转,和透明度)。所以,如果你拥有一个TextView对象,你可以移动,旋转,增高,或缩短该文本。如果它拥有一个背景图片,背景图片将伴随文本而被变换。animation包提供在一个补间动画中使用的所有类。
A sequence of animation instructions defines the tween animation, defined by either XML or Android code. As with defining a layout, an XML file is recommended because it's more readable, reusable, and swappable than hard-coding the animation. In the example below, we use XML. (To learn more about defining an animation in your application code, instead of XML, refer to the AnimationSet class and other Animation subclasses.)
一个动画指令序列定义补间动画,通过XML或Android代码来定义。正如定义一个布局所用的,建议使用一个XML文件,因为它必手工编码动画更可读,可重用,以及可交换。在下面的示例中,我们使用XML。(要想知道关于在你的应用程序代码中定义一个动画的更多信息,而非使用XML,请参考AnimationSet类以及其它Animation子类。)
The animation instructions define the transformations that you want to occur, when they will occur, and how long they should take to apply. Transformations can be sequential or simultaneous - for example, you can have the contents of a TextView move from left to right, and then rotate 180 degrees, or you can have the text move and rotate simultaneously. Each transformation takes a set of parameters specific for that transformation (starting size and ending size for size change, starting angle and ending angle for rotation, and so on), and also a set of common parameters (for instance, start time and duration). To make several transformations happen simultaneously, give them the same start time; to make them sequential, calculate the start time plus the duration of the preceding transformation.
动画指定定义你希望发生的变换,当它们将发生时,以及它们将花多长时间应用。变换可以是串行或并行的——例如,你可以让一个TextView的内容从左移动到右,然后旋转180度,或者你可以让文本同时移动并旋转。每个变换持有特定用于那个变换的一组参数(开始大小和结束大小用于大小改变,开始角度和结束角度用于旋转,等等),还有一组通用参数(例如,开始时间和持续时间)。为了让几个变换同时发生,给它们相同的开始时间;为了令它们依次发生,计算开始时间加上前一个变换的持续时间。
The animation XML file belongs in the res/anim/ directory of your Android project. The file must have a single root element: this will be either a single <alpha>, <scale>, <translate>, <rotate>, interpolator element, or <set> element that holds groups of these elements (which may include another <set>). By default, all animation instructions are applied simultaneously. To make them occur sequentially, you must specify the startOffset attribute, as shown in the example below.
动画XML文件归入你的Android工程的res/anim/目录。文件必须拥有一个根元素:它将是其中一个单一的<alpha>,<scale>,<translate>,<rotate>,插值器元素,或持有这些元素分组的<set>元素(它可以包含另一个<set>)。默认,所有动画指定被同时应用。为了让它们依次地发生,你必须指定startOffset属性,正如下面的示例中所示。
The following XML from one of the ApiDemos is used to stretch, then simultaneously spin and rotate a View object.
以下出自其中一个API演示的XML被用于拉伸,然后同时拉长(注:spin也有旋转的意思)并旋转一个View对象。
-------------------------------
<set android:shareInterpolator="false">
<scale
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:fromXScale="1.0"
android:toXScale="1.4"
android:fromYScale="1.0"
android:toYScale="0.6"
android:pivotX="50%"
android:pivotY="50%"
android:fillAfter="false"
android:duration="700" />
<set android:interpolator="@android:anim/decelerate_interpolator">
<scale
android:fromXScale="1.4"
android:toXScale="0.0"
android:fromYScale="0.6"
android:toYScale="0.0"
android:pivotX="50%"
android:pivotY="50%"
android:startOffset="700"
android:duration="400"
android:fillBefore="false" />
<rotate
android:fromDegrees="0"
android:toDegrees="-45"
android:toYScale="0.0"
android:pivotX="50%"
android:pivotY="50%"
android:startOffset="700"
android:duration="400" />
</set>
</set>
-------------------------------
Screen coordinates (not used in this example) are (0,0) at the upper left hand corner, and increase as you go down and to the right.
屏幕坐标(在这个示例中未使用)是在左上角的(0, 0),并且随着你向下走(注:待考)而增加并向右。
Some values, such as pivotX, can be specified relative to the object itself or relative to the parent. Be sure to use the proper format for what you want ("50" for 50% relative to the parent, or "50%" for 50% relative to itself).
一些值,诸如pivotX,可以相对于对象自身或相对于父对象来指定。确保使用正确的格式用于你想要的东西("50"表示相对于父对象的50%,或者"50%"表示相对于它自身的50%)。
You can determine how a transformation is applied over time by assigning an Interpolator. Android includes several Interpolator subclasses that specify various speed curves: for instance, AccelerateInterpolator tells a transformation to start slow and speed up. Each one has an attribute value that can be applied in the XML.
你可以通过赋予一个Interpolator来决定一个变换如何随时间过去而被应用。Android包含几个Interpolator子类,它们指定不同速度的曲线:例如,AccelerateInterpolator告诉变换缓慢开始然后加速。每个(注:每个插值器?)拥有可以在XML中应用的一个属性值。
With this XML saved as hyperspace_jump.xml in the res/anim/ directory of the project, the following code will reference it and apply it to an ImageView object from the layout.
带有在工程的res/anim/目录中保存为hyperspace_jump.xml的XML,以下代码将引用它并应用它到来自布局的一个ImageView对象。
-------------------------------
ImageView spaceshipImage = (ImageView) findViewById(R.id.spaceshipImage);
Animation hyperspaceJumpAnimation = AnimationUtils.loadAnimation(this, R.anim.hyperspace_jump);
spaceshipImage.startAnimation(hyperspaceJumpAnimation);
-------------------------------
As an alternative to startAnimation(), you can define a starting time for the animation with Animation.setStartTime(), then assign the animation to the View with View.setAnimation().
作为对startAnimation()的一个替换方案,你可以用Animation.setStartTime()为动画定义一个开始时间,然后用View.setAnimation()赋予动画给该View。
For more information on the XML syntax, available tags and attributes, see Animation Resources.
想获得关于XML语法,可用的标签以及属性的更多信息,参见动画资源。
-------------------------------
Note: Regardless of how your animation may move or resize, the bounds of the View that holds your animation will not automatically adjust to accommodate it. Even so, the animation will still be drawn beyond the bounds of its View and will not be clipped. However, clipping will occur if the animation exceeds the bounds of the parent View.
注意:不管你的动画可以如何移动或改变大小,持有你的动画的View的范围将不会自动地调整以适应它。虽然如此,动画将仍然超出它的视图的范围而被绘画并且将不被剪裁。然而剪裁将发生,如果动画超出父View的范围。
-------------------------------
Except as noted, this content is licensed under Apache 2.0. For details and restrictions, see the Content License.
除特别说明外,本文在Apache 2.0下许可。细节和限制请参考内容许可证。
Android 4.0 r1 - 08 Mar 2012 0:34
-------------------------------
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
(此页部分内容基于Android开源项目,以及使用根据创作公共2.5来源许可证描述的条款进行修改)
(本人翻译质量欠佳,请以官方最新内容为准,或者参考其它翻译版本:
* ソフトウェア技術ドキュメントを勝手に翻訳
http://www.techdoctranslator.com/android
* Ley's Blog
http://leybreeze.com/blog/
* 农民伯伯
http://www.cnblogs.com/over140/
* Android中文翻译组
http://androidbox.sinaapp.com/
)
发表评论
-
【翻译】(9-补丁2)电话簿提供者
2012-07-18 12:54 2331【翻译】(9-补丁2)电话簿提供者 see h ... -
【翻译】(8-补丁1)Android接口定义语言(AIDL)
2012-07-02 05:55 2849【翻译】(8-补丁1)Andro ... -
【翻译】(0)应用组件
2012-06-30 23:50 787【翻译】(0)应用组件 see http:// ... -
【翻译】(88)传感器
2012-05-21 21:25 1021【翻译】(88)传感器 ... -
【翻译】(87)复制与粘贴
2012-05-20 14:48 1882【翻译】(87)复制与粘贴 see http: ... -
【翻译】(86)音频捕捉
2012-05-16 15:14 1037【翻译】(86)音频捕捉 ... -
【翻译】(85)照相机
2012-05-13 15:09 3726【翻译】(85)照相机 see http:// ... -
【翻译】(84)JetPlayer
2012-04-21 16:24 932【翻译】(84)JetPlayer see h ... -
【翻译】(83)媒体回放
2012-04-21 16:00 1799【翻译】(83)媒体回放 see http:/ ... -
【翻译】(82)多媒体与照相机
2012-04-18 23:05 902【翻译】(82)多媒体与照相机 see htt ... -
【翻译】(23-补丁3)构建无障碍服务
2012-04-18 21:57 1580【翻译】(23-补丁3)构 ... -
【翻译】(23-补丁2)使应用程序无障碍
2012-04-16 13:08 2028【翻译】(23-补丁2)使应用程序无障碍 see ... -
【翻译】(23-补丁1)无障碍
2012-04-11 22:38 853【翻译】(23-补丁1)无 ... -
【翻译】(81)Renderscript之运行时API参考手册
2012-04-11 22:13 1374【翻译】(81)Renderscript之运行时API参 ... -
【翻译】(80)Renderscript之计算
2012-04-09 14:09 1387【翻译】(80)Renderscript之计算 ... -
【翻译】(79)Renderscript之图形
2012-04-08 13:59 2799【翻译】(79)Renderscript之图形 ... -
【翻译】(78)Renderscript
2012-04-04 15:35 1393【翻译】(78)Renderscript see ... -
【翻译】(77)可绘画对象动画
2012-03-18 10:52 664【翻译】(77)可绘画对象动画 see htt ... -
【翻译】(75)属性动画
2012-03-17 18:24 2472【翻译】(75)属性动画 see http:/ ... -
【翻译】(74)动画
2012-03-10 14:22 989【翻译】(74)动画 ...
相关推荐
这是根据Raywenderlich上How to create an Uber splash screen这篇文章实现的高仿Uber动画效果。你可以在这里找到相应的中文翻译:...
这本书旨在教你学会开发iOS应用,无论是简单的音乐播放器还是混合了动画、图片、多媒体、数据库和云存储的复杂应用。在这本书中你将掌握云服务、自动引用计数、storyboard,Interface Builder, 创建ad-hoc 并且在...
由制造目录目的具有平移或缩放视图的简单动画。安装compile ' com.github.applikeysolutions:orionpreview:1.0.1 '用法比例动画ScaleAnimation scaleAnimation = new ScaleAnimation . ScaleAnimationBuilder (view,...
处理不同的手势,如点击、长按和平移,以及动画各种视图属性,如位置、大小、旋转和 alpha。 所花费的时间 总共花费12小时 项目要求 在向左拖动消息时... ✓ 最初,显示的背景颜色应为灰色。 ✓ 当重新安排图标...
已更改: “缓存缩略图”和“选择当前动画帧”设置已从“设置”窗口移至“多媒体视图设置”窗口。 改变了:很少有化妆品变化。 修复:当PC上未安装Microsoft Visual C ++ 2010 Redistributable Package(x86)时,...
此存储库包含非常有趣的方式,您可以在保留60 FPS的同时为视图设置动画。 使用运行 变形滑块 变形SVG 动画LinearGradient 自定义滑块 3D菜单 在3D空间中变换视图 翻译菜单按钮 登录动画 自定义波纹动画 翻译...
StikkyHeader 这是一个非常简单的Android库,可让您将标题粘贴到ListView并轻松对其应用... 可用的动画是Translation , Scale和Fade ,可以在StikkyHeader的翻译过程中将其组合起来以构建动画。 例子: public clas
zoom-scroller, 在滚动图像时,创建一个微妙的缩放动画 翻译:#Zoom R 。 当 R 创建滚动时,缩放by可以以添加平滑微小的缩放动画到图像。 ,, 。许可证:属性 ShareAlike 4.0国际版。 演示视图演示插件兼容性现代...
欢迎使用Motion,该库用于为视图,图层和视图控制器创建漂亮的动画和过渡。 照片样本 查看一个示例项目,以开始使用。 谁为谁运动? Motion专为初学者到专业开发人员而设计。 对于初学者来说,您将接触到非常强大的...
ContainerViewControllerImplementing a Container View Controller 翻译 一文的Demo这是一个小小的Demo,用来实现一个最简单的容器类视图控制器首次上传,介绍比较少,因为代码比较简单,后期简书上的文章会持续...
二维绘图 CAD使多视图的二维绘图成为可能,视图空间可以从微米到米的比例范围内无限变化。它提供给机械设计师放大的功能,即使在恰当配合的装配零件中最小的元件也能看清楚,设计程序甚至能自动辨认CAD装配图中的...
翻译:謝業蘭 联系:xyl.layne@gmail.com 鸣谢:有米移动广告平台 CocoaChina 社区 目录 核心动画编程介绍.........................................................................................................
在学习到动画的这部分后,为了加深对Flutter动画实现的理解,我决定把之前写的一个卡片切换效果的开源小项目,用Flutter“翻译”一遍。 废话不多说,先来看看效果吧: Android iOS Github地址:...
改进功能 1、智能客服,即聊天机器人 ...8、缓存视图数据,提升性能,field_view_get() 改为 get_views() ,同时使用缓存对视图数据进行保存 9、其他未测试的功能 版本转换 1、转社区版功能有条码扫描、Sp
GoJS中文文档欢迎提供PR简介部分翻译进度介绍翻译状态验证核对状态基本 :check_mark_button: 建造 :check_mark_button: 使用模型数据绑定使用React的GoJ Angular的GoJ 文字区块形状图片面板桌子面板毛刷调整对象大小...
花式滚动视图 (由Google翻译)高度に柔软コアニメーションショ装できる泛用のScrollViewコンポーネントです。无限スクロールもサポートしています。要求安装Unity资产商店から购入して,さらなる开発のサポートを検...
网格/块/列表视图 HTML5+CSS3+SCSS 自定义图标包 Font Awesome图标集成 CSS3动画 基于Bootstrap3 包括Visual Composer(节省34美元) 包括革命滑块(节省25美元) 包含图层滑块(节省22美元) 即用型演示...
以自定义动画形式模态显示和关闭简单的About视图创建动画控制器定义关键帧动画使用视图快照缩放视图导航过渡:向导航控制器添加自定义推送/弹出过渡创建3D翻转动画通过UINavigationControllerDelegate连接动画控制器...
A:普通视图 B:页面视图 C:阅读版式视图 D:放映视图 答案:D 在PowerPoint中,播放动画的开始方式不能设置为( ) A:单击时 B:与上一动画同时 C:上一动画之前 D:上一动画之后 答案:C 如果用一个字节存储整数,-5的...
用于在幻灯片和游戏 UI 上制作动画效果的动态材质。用于相机、UI 和 3D/2D 游戏对象。 特点: 滚轮效果: 创建纹理幻灯片过渡。使用轮子效果将纹理 A 转换为纹理 B。 Color-Run: 在主纹理或相机视图上添加变色灯。 ...