Tag: animation

用animation开始活动

我正在尝试使用自定义过渡animation开始一个活动。 到目前为止,我发现的唯一方法是在上一个活动中不使用onPendingTransition(),而是在活动上使用自定义主题,并定义activityOpenEnterAnimation,taskOpenEnterAnimation,windowEnterAnimation或windowAnimationStyle来设置animation。 但是,这些属性都不适合我。 一些实验产生了以下结果 – 如果我将windowAnimationStyle属性设置为定义activityOpenEnterAnimation,taskOpenEnterAnimation,windowEnterAnimation或windowAnimationStyle值的自定义样式,我可以摆脱在活动开始时出现的默认过渡animation。 它不会使用指定的实际值显示过渡animation,但至less不会显示默认animation。 根据这里的参考文档, 我应该能够使用activityOpenEnterAnimation在活动开始时定义一个animation。 但迄今为止没有成功。 有任何想法吗?

如何创build一个UIView反弹animation?

我有一个名为finalScoreView的UIView的以下CATransition,它使得它从顶部进入屏幕: CATransition *animation = [CATransition animation]; animation.duration = 0.2; animation.type = kCATransitionPush; animation.subtype = kCATransitionFromBottom; animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]; [gameOver.layer addAnimation:animation forKey:@"changeTextTransition"]; [finalScoreView.layer addAnimation:animation forKey:@"changeTextTransition"]; 我该如何做到这一点,所以它一旦弹下来,然后停下来呢? 它应该仍然从顶部进入屏幕,但是当它下降时会弹起。 任何帮助将不胜感激,谢谢!

Android – 如何将视图置于屏幕外?

我试图在我的应用程序中创build一个简单的ImageViewanimation,并且我希望它从屏幕底部滑入,并进入静止位置,顶部50px的视图离开屏幕的顶部(例如最终位置的ImageView应该在-50px在X)。 我试图使用AbsoluteLayout来做到这一点,但是这实际上切断了ImageView的顶部50px,使得顶部的50px永远不会被渲染。 我需要让ImageView的顶部50像素可见/呈现animation,然后稍微离开屏幕稍微rest一下。 我希望我已经解释得很好。 这是我目前使用的布局和幻灯片animation(目前不会呈现ImageView的顶部50px): 布局: <?xml version="1.0" encoding="utf-8"?> <AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:layout_width="fill_parent" android:id="@+id/QuickPlayClipLayout"> <ImageView android:id="@+id/Clip" android:background="@drawable/clip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_y="-50dp"> </ImageView> </AbsoluteLayout> animation: <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <translate android:fromYDelta="100%p" android:toYDelta="0" android:duration="1000"/> <alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="1000" /> </set> 提前致谢。

Java:平滑的颜色转换

我正在试着做一个health bar ,就像原来的health bar ,它会开始变绿,在失去健康之后,你会发现它会变成黄色,然后变成橙色,然后变成红色……或者与之相关的东西。 我尝试使用此链接提供的方法: https : //stackoverflow.com/questions/19841477/java-smooth-color-transition 这个链接的结果是这个代码,只是一个从100到0的testing,但是它通常以Red和Green结束于IllegalArgumentException ,而我的理由是它的值超过了255。 Color to = Color.red; Color base = Color.green; int red = (int)Math.abs((100 * to.getRed()) + ((1 – 100) * base.getRed())); int green = (int)Math.abs((100 * to.getGreen()) + ((1 – 100) * base.getGreen())); int blue = (int)Math.abs((100 * to.getBlue()) + ((1 – 100) * base.getBlue())); […]

iPhone“滑动解锁”animation

关于苹果如何实现“幻灯片解锁”的任何想法(也就是另一个相同的例子)animation? 我想过某种animation蒙版 – 但是由于性能的原因,在iPhone OS上不提供蒙版。 是否有一些私人API的效果(如SuckEffect),他们可能使用? 聚光灯效果types? 一些核心animation的东西? 编辑:这绝对不是一系列的剧照。 我已经看到了编辑一个plist值的例子,并在jailbreak的iphones上自定义string。

展开/折叠棒棒糖工具栏animation(电报应用程序)

我想弄清楚工具栏的展开/折叠animation是如何完成的。 如果你看看电报应用程序设置,你会看到有一个列表视图和工具栏。 向下滚动时,工具栏折叠,当您向上滚动时展开。 还有configuration文件图片和FAB的animation。 有没有人有任何线索呢? 你认为他们把所有的animation制作在上面吗? 也许我从新的API或支持库丢失了一些东西。 我注意到Google日历应用程序中的相同行为,当您打开微调器(我不认为它是一个微调,但它看起来像):工具栏展开,当你向上滚动,它崩溃。 只是为了清除:我不需要QuickReturn方法。 我知道可能电报应用程序正在使用类似的东西。 我需要的确切方法是Google日历应用效果。 我试过了 android:animateLayoutChanges="true" 扩展方法工作得很好。 但显然,如果我向上滚动ListView,工具栏不会折叠。 我也想过添加一个GestureListener但我想知道是否有任何API或更简单的方法来实现这一点。 如果没有,我想我会和GestureListener一起去的。 希望能有一个stream畅的animation效果。 谢谢!

人体animation不平滑

下面代码中的“spaceShip”在按住任何一个箭头键的开始时并不平滑。 它移动一步,冻结一秒钟,然后“顺利”移动。 我怎样才能使它从一开始就顺利地移动,而不是“冻结”? 我的代码: <!doctype html> <html> <head> <meta http-content="Content-type" charset="utf-8"> <title>Make body move smoothly</title> <style type="text/css"> body { } canvas { margin: auto; position: absolute; left: 0; top: 0; right: 0; bottom: 0; border: 1px solid black; } </style> </head> <body> <canvas id="canvas" width="400" height="600"></canvas> <script type="text/javascript"> // Set up requestAnimationFrame and cancelAnimationFrame (function() […]

Android,沿着path移动位图?

我想知道是否有可能从一个path中select坐标来绘制一段时间的位图,例如,我有一个太阳的图像,我想随着时间的推移,沿着弧线path。 有没有什么办法来定义这样的path,然后沿着它移动,这样我就不用计算它呢? 谢谢。

通知栏自定义视图中的animation

据我所知,我们可以使用通知pipe理器+远程视图在Android中创build通知。 我正在创build一个下载MP3文件的通知。 我想在它旁边有一个animation。 到目前为止,我从论坛上了解到,这是不可能的。 然而,我看到一个android应用程序的video,下载并显示animation旁边下载它。 链接: http : //www.youtube.com/watch?v= yNcs-sS2nFU& feature=related 有人能告诉我实现它的最好方法吗?

CSS3:hover后鼠标移出animation

所以,有可能在鼠标上有反转animation,例如: .class{ transform: rotate(0deg); } .class:hover{ transform: rotate(360deg); } 但是,当使用@keyframesanimation,我不能得到它的工作,例如: .class{ animation-name: out; animation-duration:2s; } .class:hover{ animation-name: in; animation-duration:5s; animation-iteration-count:infinite; } @keyframe in{ to {transform: rotate(360deg);} } @keyframe out{ to {transform: rotate(0deg);} } 那么最佳的解决scheme是什么,知道我需要迭代和animation本身… 谢谢 http://jsfiddle.net/khalednabil/eWzBm/