草庐IT

animations

全部标签

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

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

iphone - UITableViewCell 选择器 setSelected :animated: gets called many times?

我在我的自定义UITableViewCell类中发现了setSelected:animated:的奇怪行为。我发现如果我点击表格中的一个单元格,这个函数会被多次调用。我想知道这是正常行为还是我的代码中的错误。为了帮助调试,我修改了自定义UITableViewCell类实现中的setSelected:animated:函数:-(void)setSelected:(BOOL)selectedanimated:(BOOL)animated{[supersetSelected:selectedanimated:animated];//Configuretheviewfortheselected

objective-c - UIView animation block : if duration is 0, 和没有动画一样吗?

我需要处理一种情况,您可以使用或不使用动画来做某事,而不是:if(animation){[UIViewanimateWithBlock:^(){...}];}else{...}我想做的事:[UIViewanimateWithBlock:^(){...}duration:(animation?duration:0)]但不确定它是否有效,即使有效,使用它而不是直接更改View是否有任何开销?谢谢 最佳答案 在这种情况下,我所做的是创建一个block,其中包含我想要制作的所有动画。然后执行一个UIView动画,将动画block作为参数传递

ios - UICollectionView setLayout :animated: not preserving zIndex

我注意到当在UICollectionView中调用setLayout:animated以在两个布局之间切换时,当前可见的单元格不符合zIndex它的布局属性已在layoutAttributesForItemAtIndexPath:中设置。例如,如果我有一个带有UICollectionViewFlowLayout的UICollectionView,请将它的minimumLineSpacing设置为负数,以便单元格重叠,然后将每个单元格的zIndex设置为高于前一个单元格的zIndex,然后看起来好像单元格是从下往上堆叠的。但是,如果我将布局设置为另一个布局然后返回到原始布局,这会中断。就

ios - UIWindow endDisablingInterfaceAutorotationAnimated : error

当用户在MFMailComposerViewController中并按下Home按钮时,我收到以下错误:[UIWindowendDisablingInterfaceAutorotationAnimated:]calledon>withoutmatching-beginDisablingInterfaceAutorotation.Ignoring.我看了看论坛,其他一些人在不同情况下遇到过这个错误,但没有解决方案。我已经在应用程序的所有ViewController中将shouldAutorotate设置为此:-(BOOL)shouldAutorotateToInterfaceOrient

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

ios - UIView.animate - Swift 3 - 完成

我如何在Swift3中做一个简单的完成block?我想在动画完成时设置self.isOpen=true:UIView.animate(withDuration:0.25,delay:0.0,options:[],animations:{self.isOpen=trueself.drawerView?.frame=CGRect(x:0,y:0,width:(self.drawerView?.frame.size.width)!,height:(self.drawerView?.frame.size.height)!)self.contentView?.frame=CGRect(x:200

ios - 在 iOS 4.0 中,为什么 UIScrollView zoomToRect :animated: not trigger the scrollViewDidScroll or scrollViewDidZoom delegates while animating?

我需要密切监视ScrollView的比例,以便我可以根据ScrollView的动画缩放更新内容View的元素(管理多个CALayers的subview)。在iOS3.1上,一切都按预期工作,我使用zoomToRect:animated:和UIScrollViewDelegate的scrollViewDidScroll:消息在动画发生时被重复调用,让我根据实际缩放更新subview元素。iOS4.0上的相同代码不会表现出相同的行为。当我调用zoomToRect:animated:时,委托(delegate)(scrollViewDidScroll:和scrollViewDidZoom)只

ios - [UICollectionView setCollectionViewLayout :animated:] 上的错误访问

我的UICollectionView出现奇怪的崩溃。崩溃的UICollectionView嵌入到另一个UICollectionView的UICollectionView单元中。我无法重现该问题,如果内部UICollectionView重新初始化,有时似乎会发生这种情况,因为外部CollectionView正在重新加载它的单元格。com.apple.main-threadCrashed0libobjc.A.dylibobjc_msgSend+91UIKit-[UICollectionViewData_setLayoutAttributes:atGlobalItemIndex:]+602U

ios - 使用 presentViewController :animated:completion: in iOS 8 时 presentingViewController 为 nil

想知道最近是否有其他人遇到过这个问题......对于我的一个ViewController,仅在iOS8上,在调用presentViewController:animated:completion:之后,呈现的ViewController将self.presentingController设为nil。在iOS7上没问题,在另一个ViewController上也不会发生。documentation说应该设置它,只要呈现的ViewController是模态呈现的。鉴于它适用于iOS7,这可能是iOS8的错误吗?我已经能够使用View容器包含方法绕过它,但如果有人以前见过这个并且知道触发此行为