erhu1993 / erhudemo Goto Github PK
View Code? Open in Web Editor NEW这里是所有Demo的集合,以列表形式展示
这里是所有Demo的集合,以列表形式展示
博主,我按照你添加动画的方式给imageView添加了动画效果,但启动App后第一次点击之前没有选中过的item没有动画,再点击就有动画了,你有遇到吗?
`-(void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController{
DLog(@"选中 %ld",tabBarController.selectedIndex);
[self addTabBarButtonRotationAnimationWithCurrentViewController:viewController index:tabBarController.selectedIndex];
}
(void)addTabBarButtonRotationAnimationWithCurrentViewController:(UIViewController *)currentViewController index:(NSInteger )index{
UIImageView *tabBarSwappableImageView = [self getTabBarButtonImageViewWithCurrentVc:currentViewController];
if (tabBarSwappableImageView) {
CASpringAnimation *springAnimation = [CASpringAnimation animationWithKeyPath:@"bounds"];
springAnimation.fromValue = [NSValue valueWithCGRect:CGRectMake(tabBarSwappableImageView.centerX, tabBarSwappableImageView.centerY, tabBarSwappableImageView.width*0.85, tabBarSwappableImageView.width*0.85)];
springAnimation.toValue = [NSValue valueWithCGRect:tabBarSwappableImageView.frame];
//质量,影响图层运动时的弹簧惯性,质量越大,弹簧拉伸和压缩的幅度越大 Defaults to one
springAnimation.mass = 3;
//刚度系数(劲度系数/弹性系数),刚度系数越大,形变产生的力就越大,运动越快 Defaults to 100
springAnimation.stiffness = 1300;
//阻尼系数,阻止弹簧伸缩的系数,阻尼系数越大,停止越快 Defaults to 10
springAnimation.damping = 20;
//速率为正数时,速度方向与运动方向一致,速率为负数时,速度方向与运动方向相反
springAnimation.initialVelocity = -10 ;
//估算时间 返回弹簧动画到停止时的估算时间,根据当前的动画参数估算
springAnimation.duration = springAnimation.settlingDuration;
springAnimation.removedOnCompletion = YES;
[[tabBarSwappableImageView layer] addAnimation:springAnimation forKey:nil];
NSLog(@"添加");
}
}
(UIImageView *)getTabBarButtonImageViewWithCurrentVc:(UIViewController *)currentViewController{
UIControl *tabBarButton = [currentViewController.tabBarItem valueForKey:@"view"];
if (tabBarButton) {
UIImageView *tabBarSwappableImageView = [tabBarButton valueForKey:@"info"];
if (tabBarSwappableImageView) {
return tabBarSwappableImageView;
}
}
return nil;
}`
tabbaritem刷新动画的时候,想同时修改下文字,怎么修改?用的哪个kvo
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.