Tag: iosanimation

UiView.animateWithDuration不能animationSwift

我正在尝试使用下面的代码来animation显示/隐藏search栏(search栏应该从左边开始,并在1-2秒内向右扩展)。 但是,无论我投入了多less时间,它都不会立即显示animation和search条。 我注意到下面 持续时间不受尊重 甚至不延迟被尊重 animation没有发生。 组件立即显示 func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) { //code to get selected value… //Hide the collection view and show search bar UIView.animateWithDuration(10.0, delay: 0.0, options: UIViewAnimationOptions.TransitionCrossDissolve, animations: { self.searchBar.hidden = false self.searchBar.frame = CGRectMake(0, 0, 300, 44) //This doesn't work either }, completion: { (finished: Bool) in return true […]