- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经实现了一个 UIButton 动画,至于现在它会缩放,但我还想在 UIButton 消失时交叉淡入淡出。
这是我的按钮动画示例代码。
(void)centerButtonAnimation{
CAKeyframeAnimation *centerZoom = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
centerZoom.duration = 1.5f;
centerZoom.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(1, 1, 1)],[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.5, 1.5, 1.5)],[NSValue valueWithCATransform3D:CATransform3DMakeScale(4, 4, 4)],[NSValue valueWithCATransform3D:CATransform3DMakeScale(5, 5, 5)]];
centerZoom.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
centerButton.transform = CGAffineTransformMakeScale(5, 5);
[centerButton.layer addAnimation:centerZoom forKey:@"buttonScale"];
[centerButton setUserInteractionEnabled:NO];
}
最佳答案
要链接动画,您可以将您的类设置为动画的委托(delegate)。
@property CAKeyframeAnimation *centerZoom;
- (void) centerButtonAnimation
{
self.centerZoom = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
// Set the delegate to this instance.
centerZoom.delegate=self;
centerZoom.duration = 1.5f;
centerZoom.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeScale(1, 1, 1)],[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.5, 1.5, 1.5)],[NSValue valueWithCATransform3D:CATransform3DMakeScale(4, 4, 4)],[NSValue valueWithCATransform3D:CATransform3DMakeScale(5, 5, 5)]];
centerZoom.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
centerButton.transform = CGAffineTransformMakeScale(5, 5);
[centerButton.layer addAnimation:centerZoom forKey:@"buttonScale"];
[centerButton setUserInteractionEnabled:NO];
}
- (void) crossFadeAnimation
{
// Insert animation code for cross fade.
}
然后实现委托(delegate)函数来检测动画的结束。如果是缩放结束,则开始交叉淡入淡出。
- (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag
{
if ((theAnimation == self.centerZoom) && flag){
[self crossFadeAnimation];
}
}
关于ios - 如何制作 uibutton zoomout 然后 crossblur?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29941058/
我正在使用来自 here 的 TouchImageView . 我正在尝试为双击实现 ZoomOut。我已经部分完成了。但是,缩小时我遇到了一些问题。如果我缩放图像并双击,则图像无法正确呈现。 这是我
我想知道如何使用 Google Maps API 平滑地放大动画。 我有两分,一分在中国,一分在法国。当我放大中国时,点击法国按钮。我希望它逐渐平滑缩小,一次缩放一个级别。当它被缩小时,它应该平移到新
我准备一个图片库,我想放大和缩小已经在页面控制和 ScrollView 中的图像。有人可以帮我.. 问候.. 最佳答案 为 ScrollView 设置委托(delegate)。以下代码缩放您的图像。
我已经实现了一个 UIButton 动画,至于现在它会缩放,但我还想在 UIButton 消失时交叉淡入淡出。 这是我的按钮动画示例代码。 (void)centerButtonAnimation{
您能帮我解决 Appium 中 Java for Android 的缩放/捏合工作方法吗? 我已经尝试过使用 MultiTouch 操作 ( How to zoom in a mobile web u
我在我的ImageView中使用了PinchGesture。此代码运行完美,现在我想在某个尺寸处停止ZoomOut,我应该做什么? UIPanGestureRecognizer *panGesture
我创建了一个自定义缩放控件并希望在单击时放大和缩小...我可以访问 Google v3 API 中默认为 zoomIn 和 zoomOut 的方法吗? 最佳答案 不,没有这样的功能。您只需调用 map
我需要将 swipeGesture 添加到我的 UIWebView,但是我需要停止那个 UIWebView 的 ZoomIn 和 ZoomOut /*Swipe is enabled and zoom
我正在尝试在我的 Activity 的 oncreateMethod 中放大 Google MapView。每次我尝试通过 mapController 缩放 map 时,我都会收到 IllegalAr
我正在使用 http://daneden.github.io/animate.css/ 中的 animate.css|并且有 2 个很酷的转换,我想集成或自定义到我的 jquery 移动应用程序,其中
我是一名优秀的程序员,十分优秀!