uiviewanimation

Creating slow scrolling to indexPath in UICollectionView

送分小仙女□ 提交于 2019-12-28 04:01:10
问题 I'm working on a project where I'm using a UICollectionView to create an 'image ticker' where I'm advertising a series of logos. The collectionView is one item high and twelve items long, and shows two to three items at a time (depending on size of the logos visible). I would like to make a slow automatic scrolling animation from the first item to the last, and then repeat. Has anyone been able to make this work? I can get the scrolling working using [myCollection scrollToItemAtIndexPath:

How can I animate a UITableViewCell's colors?

情到浓时终转凉″ 提交于 2019-12-25 11:33:36
问题 I want to allow the user to switch between a few color palettes in the application, IE how XCode and other text editors allow you to switch between light and dark backgrounds. I'm able to do all this simply enough, but now I'm trying to wrap the change in a simple animation block so the color changes fade in. Everything works great with the exception of my table view cells. The colors change, but they don't animate. [UIView animateWithDuration:0.5 animations:^{ self.tableView.backgroundColor

Issue with loading and caching retina images for UIImageView animation

前提是你 提交于 2019-12-25 03:52:43
问题 What I have For my game I'm creating several animations using view.animationImages = imagesArray; [view startAnimating]; In my animation helper class I use this - (UIImage *)loadRetinaImageIfAvailable:(NSString *)path { NSString *retinaPath = [[path stringByDeletingLastPathComponent] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@@2x.%@", [[path lastPathComponent] stringByDeletingPathExtension], [path pathExtension]]]; if ([UIScreen mainScreen].scale == 2.0 && [[NSFileManager

How to autorepeat a set of chained UIView animations using UIViewAnimationOptionRepeat

百般思念 提交于 2019-12-25 03:01:05
问题 I am trying to chain a set of UIView animateWithDuration: using the flag UIViewAnimationOptionRepeat The animation steps I am trying to repeat are: Animate a UIView 100 pixels to the left Fade the UIView out (opacity '0' ) While faded out (invisible), move it back to the original position (100 px to the right) Fade the UIView back in (set opacity to '1' ) Repeat the animation using flag UIViewAnimationOptionRepeat I am not able to repeat the whole chain of animations - and only able to repeat

UIView animation continues to run after a new view controller is pushed onto the stack

天大地大妈咪最大 提交于 2019-12-24 02:52:43
问题 Solved. Ridiculously embarrassing. I wasn't using an instance variable, I declared it outside of curly braces in the implementation. Really struggling. I have a view controller that manages an animated countdown timer. The animation is using recursive UIView animation and a simple int ivar that gets decremented. Something like the following (this is a simplified snippet): - (void) animate { [UIView animateWithDuration:0.75f delay:0.25f options:UIViewAnimationCurveEaseInOut animations:^{ aView

Why does setting a UILabel to be fully transparent lose tap gestures?

跟風遠走 提交于 2019-12-23 18:13:53
问题 I can't figure this out, and I don't think this really explains it either. I have a UILabel that can be tapped by the user to hide or show it, set up like this: self.numberLabel.userInteractionEnabled = YES; UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideOrShowNumber)]; [self.numberLabel addGestureRecognizer:tapGesture]; I would like to animate the hiding and showing of the label by setting the alpha value on the UILabel . However

iOS Swift: UIViewControllerAnimatedTransitioning end frame in wrong position

元气小坏坏 提交于 2019-12-23 15:45:03
问题 I have a Swift project, learning a weather API and also trying to get a better handle on the AnimatedTransitions. I have a UITableView using a custom UITableViewCell with images and text. Tapping a cell in the tableView transitions to a new UIViewController as a Show (push), with the whole thing embedded in a UINavigationController . When the transition is invoked, the image from the cell is supposed to move to the final location of the UIImageView on the destination viewController. However,

Get current position of animated scrollview

僤鯓⒐⒋嵵緔 提交于 2019-12-23 06:59:20
问题 i got the following problem. i subclassed a uiscrollview which contentOffset is animated by this code: [UIView animateWithDuration:1.0 delay:1.0 options:options animations:^{ self.contentOffset = CGPointMake(label.frame.size.width, 0); } completion:^(BOOL completed) { //some other stuff }]; Now, when the user "willBeginDragging" the scrollview, i want to stop the current animation and set the scrollview.contentoffset to the current position it has in the uianimation. for example, the user

user action in uiviews buttons disabled after frame resizing

寵の児 提交于 2019-12-23 05:13:10
问题 I do have a UIView subclass, lets call it PopupView. inside this PopupView i do have a NavigationBar with a custom uiview and a uibutton (2) inside it. Also there is a UIButton (1) directly inside the PopupView. PopupView - UIButton (1) - UINavigationBar - UINavigationItem - UIBarButtonItem - UIView - UIButton (2) the reason of this uibutton in uinavigationbar crazyness is because i can use capinsets for backgroundimages in a uibutton but not for a uibarbuttonitem. My Problem: i resize the

Custom UIButton class for button touch event

匆匆过客 提交于 2019-12-23 04:55:31
问题 Is it possible to create a custom UIButton class with an touch event animation which gets automatically invoked everytime the user touches the button? import UIKit class AnimatedButton: UIButton { @objc private func buttonClicked(sender: UIButton) { UIView.animate(withDuration: 0.5, delay: 1.0, usingSpringWithDamping: 1.0, initialSpringVelocity: 0.2, options: .curveEaseOut, animations: { //do animation sender.transform = CGAffineTransform(scaleX: 0.6, y: 0.6) }, completion: nil) } } So I don