Tabbar点击时候超炫小动画
来源:互联网 发布:js点击之前事件 编辑:程序博客网 时间:2024/05/17 22:33
//代码粘贴到 UITabBarController控制器即可 效果如上
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item {
NSInteger index = [self.tabBar.items indexOfObject:item];
if (self.selectedIndex != index) {
[self animationWithIndex:index];
}
}
// 动画
- (void)animationWithIndex:(NSInteger) index {
NSMutableArray * tabbarbuttonArray = [NSMutableArray array];
for (UIView *tabBarButton in self.tabBar.subviews) {
if ([tabBarButton isKindOfClass:NSClassFromString(@"UITabBarButton")]) {
[tabbarbuttonArray addObject:tabBarButton];
}
}
CABasicAnimation*pulse = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
pulse.timingFunction= [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
pulse.duration = 0.08;
pulse.repeatCount= 1;
pulse.autoreverses= YES;
pulse.fromValue= [NSNumber numberWithFloat:0.7];
pulse.toValue= [NSNumber numberWithFloat:1.3];
[[tabbarbuttonArray[index] layer]
addAnimation:pulse forKey:nil];
self.selectedIndex = index;
}
1 0
- Tabbar点击时候超炫小动画
- iOS tabbar点击动画效果实现
- tableView点击push跳转的时候,隐藏底部的tabbar栏
- tabbar点击刷新
- 点击tabBar跳转
- 点击tabbar刷新页面
- 给自定义tabBar的按钮添加点击放大缩小的动画
- IOS 自定义tabBar的按钮添加点击放大缩小的动画
- tabBar隐藏动画,hidesBottombarWhenPushed
- 【代码笔记】iOS-点击cell时候的动画翻转
- 使用animateWithDuration动画的时候无法响应点击事件
- ios点击隐藏tabBar 返回tabBar
- LeveyTabBar点击Tabbar刷新页面
- IOS tabbar 点击刷新页面
- 如何监听Tabbar的点击
- 彩色TabBar切换动画实现
- 带有动画效果的tabbar
- 点击tabBar返回到当前tabBar的初始视图
- 开学第一课
- The import java.io cannot be resolved 问题解决
- Mysql必知必会(笔记)【分组函数,子查询, 联结,高级联结,组合查询】
- Odoo ORM API(六)- Inheritance and extension and Domains
- vbox错误:被召者 RC: REGDB_E_CLASSNOTREG (0x80040154)
- Tabbar点击时候超炫小动画
- 欢迎使用CSDN-markdown编辑器
- 黑客与画家
- android提供外部资源的规则和注意事项
- Scala if Statements
- iOS 获取通讯录
- ras工具类
- 【转载】《计算机教育》专题报道:从一个教育实例,看信息技术对教育的影响
- 关于建表的补充