UIView动画animation 水平移动UILabel
2014-04-17 16:06
393 查看
这样的_currentChosedLabel会从最初的位置动画移动到下面设置的位置;
[UIView animateWithDuration:0.3950
animations:^{
_currentChosedLabel.frame =
CGRectMake(sender.frame.origin.x,
_currentChosedLabel.frame.origin.y, sender.frame.size.width,
_currentChosedLabel.frame.size.height);
} completion:^(BOOL finished){
}];
// [UIView beginAnimations:nil context:NULL];
// [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
// [UIView setAnimationBeginsFromCurrentState:YES];
// [UIView setAnimationDuration:0.3950];
// _currentChosedLabel.frame = CGRectMake(sender.frame.origin.x, _currentChosedLabel.frame.origin.y, sender.frame.size.width, _currentChosedLabel.frame.size.height);
// [UIView commitAnimations];
[UIView animateWithDuration:0.3950
animations:^{
_currentChosedLabel.frame =
CGRectMake(sender.frame.origin.x,
_currentChosedLabel.frame.origin.y, sender.frame.size.width,
_currentChosedLabel.frame.size.height);
} completion:^(BOOL finished){
}];
// [UIView beginAnimations:nil context:NULL];
// [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
// [UIView setAnimationBeginsFromCurrentState:YES];
// [UIView setAnimationDuration:0.3950];
// _currentChosedLabel.frame = CGRectMake(sender.frame.origin.x, _currentChosedLabel.frame.origin.y, sender.frame.size.width, _currentChosedLabel.frame.size.height);
// [UIView commitAnimations];
相关文章推荐
- IOS-相对移动(CGAffineTransformMakeTranslation()),动画UIViewAnimationOptions
- iOS开发-CALayer/Core Animation/UIView动画封装
- iOS 动画 UIView CoreAnimation 回到初始状态
- 旋转动画 uiview animation rotate
- UIView分类之动画移动效果
- iOS-Swift-CAKeyframeAnimation动画(UILabel左右晃动)
- ios之UIView执行基础动画Animation使用参数配置
- iOS开发 - UIView动画扩展块(UIViewAnimationWithBlocks)
- 自定义push viewcontroll 的动画 (Custom animation for pushing a UIViewController)
- iOS UIView animation动画效果 (1)
- ios-day18-11(使用CAAnimationGroup实现对UIView的组合动画)
- UIView动画移动效果
- animation在手机上直角坐标系,即动画移动的轴
- swift2.0 CASpringAnimation 和 UIView.animateWithDuration 分别实现弹性动画
- animation动画特效--一个能随移动而变色的区域
- iOS 动画Animation详解, UIView动画,CALayer动画
- UIView动画【渐入alpha、淡出、移动frame、缩放transform、旋转transform rotation】
- IOS学习之路(二十五)UIView动画,弹出后移动然后消失
- UIView动画animation
- uiview的animation动画