草庐IT

Animations

全部标签

iphone - 尝试使用 animateWithDuration 时找不到方法 '+animateWithDuration:delay:options:animations:'

-(void)fadeLabel{UILabel*label=(UILabel*)[self.viewviewWithTag:kLabelTag];[UIViewanimateWithDuration:2.0delay:0.0options:UIViewAnimationCurveEaseInanimations:^{label.alpha=0.0;}];}我第一次尝试制作任何东西的动画给了我:尝试使用animateWithDuration时找不到方法“+animateWithDuration:delay:options:animations:”我不知道导致此错误的原因,但我的代码与所

android - 支持库 : FragmentTransaction animations not working

我正在使用PeterDoyle的android-support-v4-googlemaps实现同时使用fragment和谷歌地图的Activity的支持库,并且似乎无法使FragmentTransaction动画工作。我试过使用setCustomAnimations(intenter,intexit)方法以及setTransition(inttransit)方法但无济于事。任何人都能够使动画正常工作,或者在使动画正常工作时遇到问题?我试过的一些动画:setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE)setCustomAnim

objective-c - UIView animateWithDuration : animations: completion: applies transform, 没有动画

试图从KVO观察调用此消息。下载图像后,将发送此消息。完成block中的消息还包含一个正常工作的动画(动画正确)。此动画在不发生动画的情况下应用变换(等待动画的长度,然后跳转到最终状态)。/***Discoverthesubviewwiththesuppliedtag,attachthefullsizeimagetotheview*scaletofullsizeandbeginretract.*@paramviewTagint-#FUTUREUSE#-Thetagoftheviewtobeanimated.*@paramimageUIImage-#FUTUREUSE#-Theimage

ios - UITableView 在 'Attempt to create two animations for cell' 中的同一批更新结果中重新加载和移动行

这是一个简单的例子(基本上是从“Master-Detail”Xcode模板制作的)。我试图在UITableView的批量更新中移动一行("B")并重新加载另一行("A1"->"A2")。-(void)awakeFromNib{[superawakeFromNib];self.objects=@[@"B",@"A1"];}-(IBAction)boom{self.objects=@[@"A2",@"B"];NSIndexPath*path0=[NSIndexPathindexPathForRow:0inSection:0];NSIndexPath*path1=[NSIndexPathin

iphone - 我们可以为 UIView 的 transitionWithView :duration:options:animations:completion: method? 传递多个选项吗

我正在尝试为UIView的transitionWithView:duration:options:animations:completion:方法传递多个选项。更具体地说,我需要UIViewAnimationOptionTransitionCurlUp和UIViewAnimationOptionAllowUserInteraction选项,因为我的UI在动画期间没有响应。如有任何帮助,我们将不胜感激。 最佳答案 是的,只需使用|运算符对它们执行按位或运算,然后组合它们-例如:[UIViewtransitionWithView:con

iphone - UINavigationController - setNavigationBarHidden :animated: How to sync other animations

编程隐藏导航栏时如何捕捉动画曲线和速度?我想将其他动画与此动画同步以实现流畅的过渡:) 最佳答案 如果您查看UINavigationController文档,则有这一行:Foranimatedtransitions,thedurationoftheanimationisspecifiedbythevalueintheUINavigationControllerHideShowBarDurationconstant. 关于iphone-UINavigationController-setN

ios - UIView.animateWithDuration :animations:completion: gets canceled in XCTest

我正在尝试对UIView上的扩展进行单元测试,它调用animateWithDuration:animations:completion:。不幸的是,测试用例中的所有动画都立即取消,因此完成block的isFinished参数始终为false。有没有人知道如何让动画在测试用例中工作?这是我的Playground代码:importUIKitimportXCTestextensionUIView{funcfadeOut(duration:TimeInterval,completion:((Bool)->Void)?){UIView.animate(withDuration:duration,

objective-c - UIView animateWithDuration : duration: animations: completion: seems to have a default transition?

在我的程序中,我想创建一个以恒定速度移动的动画。看起来动画开始缓慢,加速然后缓慢结束。有什么办法可以改变吗? 最佳答案 您可以使用animateWithDuration:delay:options:animations:completion:选项更改此设置。为选项参数发送一个UIViewAnimationOption掩码。这些是您感兴趣的选项:UIViewAnimationOptionCurveEaseInOutUIViewAnimationOptionCurveEaseInUIViewAnimationOptionCurveEas

ios - drawViewHierarchyInRect :afterScreenUpdates: delays other animations

在我的应用程序中,我使用drawViewHierarchyInRect:afterScreenUpdates:来获取我的View的模糊图像(使用Apple的UIImage类别UIImageEffects)。我的代码是这样的:UIGraphicsBeginImageContextWithOptions(self.view.bounds.size,NO,0);[self.viewdrawViewHierarchyInRect:self.view.boundsafterScreenUpdates:YES];UIImage*im=UIGraphicsGetImageFromCurrentIma

iphone - 正确使用 transitionFromViewController :toViewController:duration:options:animations:completion:

我似乎找不到关于如何正确使用transitionFromViewController:toViewController:duration:options:animations:completion:的好例子。这是正确的吗?(假设我想用另一个VC交换)//AssumefromVCandtoVCviewcontrollersaredefinedandfromVCisalreadyaddedasachildviewcontroller[selfaddChildViewController:toVC];[selftransitionFromViewController:fromVCtoView