uiviewanimation

UIViewAnimationOptionBeginFromCurrentState unexpected behaviour with basic animation

亡梦爱人 提交于 2019-12-21 12:58:38
问题 I am trying to perform this basic UIView animation upon receiving a button click: - (IBAction)buttonPress:(id)sender { self.sampleView.alpha = 0.0; [UIView animateWithDuration:2.0 delay:0.0 options:UIViewAnimationOptionCurveEaseInOut | UIViewAnimationOptionBeginFromCurrentState animations:^{self.sampleView.alpha = 1.0;} completion:NULL]; } Prior to the button click the view is visible and has an alpha value of 1.0. When I send the button action I expect the view to fade in from alpha=0.0 to

Animated curve line in Swift 3

我的未来我决定 提交于 2019-12-20 09:07:19
问题 I want to draw some bezier lines and I want to animate them with a wave effect, Example Do you have some ideas about how I can do this ? Bezier line is it the best method to do it ? I found only 2 libs for this, but they are not really useful for what I need, I try to modify the code of one lib, unfortunately without success https://github.com/yourtion/YXWaveView I found this lib, https://antiguab.github.io/bafluidview/ which does the work, but it written in obj-c, maybe you know something

iOS UIView Animation CATransform3DMakeRotation confusion

天大地大妈咪最大 提交于 2019-12-19 10:37:22
问题 I have a UIView that I am trying to animate flipping down, while having its axis at the bottom of the view. E.g.: To do this, I am trying to use a UIView animation: [UIView animateWithDuration:3 delay:0 options:UIViewAnimationCurveEaseOut animations:^{ // Flip Down top3.layer.anchorPoint = CGPointMake(0.5, 1.0); top3.layer.transform = CATransform3DMakeRotation(M_PI, 1, 0, 0); } completion:^(BOOL finished) { // Reset? //top3.transform = CGAffineTransformMakeScale(1, 1); }]; Right now it isn't

Animated Images in a UIButton

余生颓废 提交于 2019-12-18 12:18:10
问题 What is the best way to animate images of a button? Say I want to cycle through like 6 frames and have the user still be able to click the button? Should I animate the images and just have an invisible button on top of it in interface builder? Is there a way to animate them within defining the UIButton ? Or is it better to animate images and find the users touch point and act on that? 回答1: You can do this using the imageView property of UIButton . This will allow the button to behave as it

Synchronizing Animations in keyboardWillShow keyboardWillHide — Hardware Keyboard & Virtual Keyboard Simultaneously

房东的猫 提交于 2019-12-18 11:50:08
问题 Preamble So I have an application featuring a chat section, and I'm synchronizing the animation of the keyboard hiding and showing with the rise and fall of the chat input. Here's the code I'm using: SHOW: - (void) keyboardWillShow:(NSNotification *)note { NSDictionary *keyboardAnimationDetail = [note userInfo]; UIViewAnimationCurve animationCurve = [keyboardAnimationDetail[UIKeyboardAnimationCurveUserInfoKey] integerValue]; CGFloat duration = [keyboardAnimationDetail

Animate collection view cells [closed]

穿精又带淫゛_ 提交于 2019-12-18 11:14:11
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year . How to animate collection view cells like a closing or a sliding from the left-right door in iOS. like this: 回答1: This is code for animation collection view cells like a closing door. This collection has 2 columns. I have added code for UICollectionViewDelegateFlowLayout methods for collection view

Animating UIView doesn't working as expected

被刻印的时光 ゝ 提交于 2019-12-18 07:17:17
问题 In my application i am using a UIView which includes UITableView , Buttons and Labels in it. It created using Storyboard . When user click a navigation bar button UIView will appear with animation from top to certain height and if they click it again it hides the UIView with animation(From that height to top). Same like UIActionView . It works fine if there is no records in UITableView . But if it has any records, while calling [self hideBasket] the UIView appears from bottom of the view to

How to cancel UIViews block-based animation?

佐手、 提交于 2019-12-18 03:05:25
问题 i currently focus the following problem: i start an animation, where 2 objects-attributes are triggered. the code is: [UIView animateWithDuration:0.3 animations:^{ greyscaleImage.alpha = 1; activityIndicator.alpha = 1; } completion:^(BOOL f){ if(f) { [activityIndicator startAnimating]; } }]; which works fine. the only problem i discovered is, that i have a 0.3 seconds change to crash the app when the view which holds this activityIndicator and greyscaleImage is deallocated. To make it more

Auto Layout constraint change does not animate

爷,独闯天下 提交于 2019-12-18 02:48:14
问题 I was learning the auto layout with animations from the tutorial http://weblog.invasivecode.com/post/42362079291/auto-layout-and-core-animation-auto-layout-was and things were working perfect. When I tried to use this concept in my application, trying to animate a settings screen(a UIView) from bottom to top,it works great when the settings screen is just an empty UIView, But in case I add a UILabel as a subview to this settings screen, the animation just vanishes. On removing this UILabel

UIView.animateWithDuration swift loop animation

只愿长相守 提交于 2019-12-17 22:44:23
问题 In ViewController.Swift I managed to make a box animate from one point to another. I thought it would be easy to loop this so the box will animate to one point and then animate back to its original position and then loop again. I have managed to move the object to a position and in "complete" move it back again, but that doesn't make i loop. How can this be achieved? I thought maybe this could work but i honestly don't know: let boxmoves = [CGRect(x: 120, y: 220, width: 100, height: 100),