-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
引入lottie动画,设置badge失效 #371
Comments
setViewDidLayoutSubViewsBlockInvokeOnce |
内部没有使用延迟操作 |
加一个延时试试 |
badge的设置方法贴一下,我确认下你的api。 |
参考demo做法,demo里跟你的效果一致。 |
好的,谢谢回复,真的好及时! |
你确认下是不是最新版吧,我记得这个问题修复了。 |
建议 app启动后就给icon加红点的情况下,加一个延时,lottie图片加载可能比一般的静态图片略微延迟。 //添加提示动画,引导用户点击
[tabBarController setViewDidLayoutSubViewsBlockInvokeOnce:YES block:^(CYLTabBarController *tabBarController) {
NSUInteger delaySeconds = 1;
dispatch_time_t when = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delaySeconds * NSEC_PER_SEC));
dispatch_after(when, dispatch_get_main_queue(), ^{
@try {
UIViewController *viewController0 = tabBarController.viewControllers[0];
// UIControl *tab0 = viewController0.cyl_tabButton;
// [tab0 cyl_showBadge];
[viewController0 cyl_setBadgeBackgroundColor:RANDOM_COLOR];
[viewController0 cyl_setBadgeCenterOffset:CGPointMake(-5, 3)];
[viewController0 cyl_setBadgeRadius:5/2];
[viewController0 cyl_setBadgeMargin:1];
[viewController0 cyl_showBadge];
[tabBarController.viewControllers[1] cyl_showBadgeValue:@"" animationType:CYLBadgeAnimationTypeScale];
[tabBarController.viewControllers[1] cyl_setBadgeBackgroundColor:RANDOM_COLOR];
[tabBarController.viewControllers[2] cyl_showBadgeValue:@"test" animationType:CYLBadgeAnimationTypeShake];
[tabBarController.viewControllers[3] cyl_showBadgeValue:@"100" animationType:CYLBadgeAnimationTypeBounce];
[tabBarController.viewControllers[4] cyl_showBadgeValue:@"new" animationType:CYLBadgeAnimationTypeBreathe];
} @catch (NSException *exception) {}
//添加仿淘宝tabbar,第一个tab选中后有图标覆盖
if ([self cyl_tabBarController].selectedIndex != 0) {
return;
}
// tabBarController.selectedIndex = 1;
});
}]; |
嗯嗯,谢谢回复 |
客气,后期有问题,多多反馈。 |
欢迎加我微信交流.我的id是chenyilong1010。另外使用 CYLTabBarController 做的 APP,来这里报道下吧! #314 |
Base Info for this issue
1. How to reproduce the problem.
1.tabBarItemsAttributesForController (我这边item是通过lottie进行动画的,很高兴看到最新版支持lottie),添加了 CYLTabBarLottieURL 这个 key
2.[self cyl_tabBarController] setViewDidLayoutSubViewsBlockInvokeOnce...
按照建议在这边设置badge
然后,badge就失效了,因为我去掉 CYLTabBarLottieURL 这个key之后,badge都正常了
2. Please help me in this way.
badge 不与 lottie 相互影响
3. Here is a Demo.
我直接在项目中集成的,demo,不好提供,希望问题我已经讲清楚了
4. Here is my Debug log
The text was updated successfully, but these errors were encountered: