-
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
Tabbar的黑线,能否自定义颜色? #388
Comments
tabbar 的 background image 有值时,shadow image设置才会生效。 |
demo演示代码里注释里说明了。 |
您好,谢谢回复! |
自定义shadowImageview不生效吗? |
可以了,谢谢! |
怎么生效的,上面的代码做了什么改动? |
UIGraphicsBeginImageContextWithOptions(CGSizeMake(kCutUIWidth(375), 1), 0, [UIScreen mainScreen].scale); 自定义一张1像素高度的纯颜色的image,然后放在setShadowImage里面 |
你上面的代码有一个前提,必须调用了下面的代码:
|
是的 |
见README 并参考:#386 |
Base Info for this issue
1. How to reproduce the problem.
//以下方法能把顶部黑线隐藏掉,但目前的需求是改变黑线的颜色,请问能否实现
[mainCon hideTabBadgeBackgroundSeparator];
我通过以上方式看到获取的是一个UIImageView,所以我把ImageView的填充颜色改为红色,但还是没法生效,具体代码如下:
[mainCon.tabBar layoutIfNeeded];
UIImageView * tabBadgeBackgroundSeparatorImgView = mainCon.tabBar.cyl_tabBadgeBackgroundSeparator;
[tabBadgeBackgroundSeparatorImgView setImage:[tabBadgeBackgroundSeparatorImgView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]];
tabBadgeBackgroundSeparatorImgView.tintColor = kRedColor;
2. Please help me in this way.
3. Here is a Demo.
4. Here is my Debug log
The text was updated successfully, but these errors were encountered: