CYLTabBarController icon indicating copy to clipboard operation
CYLTabBarController copied to clipboard

[bug]:xcode11 build 的iOS13下 图片下移或者无法点击

Open sillker opened this issue 5 years ago • 15 comments

首先不太确定具体bug原因,但是经过测试发现通过下面修改就没问题了,如下:

CYLTabBar.m Line:186 修改为[self setupTabImageViewDefaultOffset:self.selectedItem.cyl_tabButton]即可

这里不明白为啥作者写法self.tabBarButtonArray[0],一直取第一个导致非第一个tabbar会设置tabImageViewDefaultOffset。

ps:以上只是个人粗略查看修改测试,不一定就是问题所在,可能碰巧而已,还是辛苦作者赶紧修复bug。



Base Info for this issue

  1. Version:Latest Version as here
  2. Language of App :Objective-C/Swift
  3. iOS System Version:iOS12
  4. Prototype(是否是真机):YES
  5. Issue Type:Crash、Bug、Enhancement(希望能支持一个新需求)、Q-A

1. How to reproduce the problem.

2. Please help me in this way.

3. Here is a Demo.

4. Here is my Debug log


sillker avatar Sep 24 '19 07:09 sillker

遇到同样的问题,除第一个tabBarItem外,其他选项在push新页面后pop回来,标题文字会消失。请问如何设置

CalvinLeo avatar Oct 10 '19 10:10 CalvinLeo

遇到同样的问题,除第一个tabBarItem外,其他选项在push新页面后pop回来,标题文字会消失。请问如何设置

我又看了后面的一些issue,发现这段代码是可以解决文字消失的,我想应该是需要设置一下默认状态下的 textAttributes.

if (@available(iOS 13.0, *)) {
    UITabBarAppearance *standardAppearance = [[UITabBarAppearance alloc] init];
    UITabBarItemAppearance *inlineLayoutAppearance = [[UITabBarItemAppearance  alloc] init];
    [inlineLayoutAppearance.normal setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10], NSForegroundColorAttributeName:RGB(169, 181, 208)}];
    [inlineLayoutAppearance.selected setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10], NSForegroundColorAttributeName:CclearBlue(1)}];
    standardAppearance.stackedLayoutAppearance = inlineLayoutAppearance;
    standardAppearance.backgroundColor = [UIColor whiteColor];
    standardAppearance.shadowImage = [UIImage imageWithColor:CpaleGrey(1)];
    self.tabBar.standardAppearance = standardAppearance;
}

CalvinLeo avatar Oct 10 '19 12:10 CalvinLeo

遇到同样的问题,除第一个tabBarItem外,其他选项在push新页面后pop回来,标题文字会消失。请问如何设置

我是pop回来后,所有tabBarItem的标题文字都消失了

muzihe avatar Oct 10 '19 14:10 muzihe

遇到同样的问题,除第一个tabBarItem外,其他选项在push新页面后pop回来,标题文字会消失。请问如何设置

我又看了后面的一些issue,发现这段代码是可以解决文字消失的,我想应该是需要设置一下默认状态下的 textAttributes.

if (@available(iOS 13.0, *)) {
    UITabBarAppearance *standardAppearance = [[UITabBarAppearance alloc] init];
    UITabBarItemAppearance *inlineLayoutAppearance = [[UITabBarItemAppearance  alloc] init];
    [inlineLayoutAppearance.normal setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10], NSForegroundColorAttributeName:RGB(169, 181, 208)}];
    [inlineLayoutAppearance.selected setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10], NSForegroundColorAttributeName:CclearBlue(1)}];
    standardAppearance.stackedLayoutAppearance = inlineLayoutAppearance;
    standardAppearance.backgroundColor = [UIColor whiteColor];
    standardAppearance.shadowImage = [UIImage imageWithColor:CpaleGrey(1)];
    self.tabBar.standardAppearance = standardAppearance;
}

你这个是对的

mozartee avatar Oct 11 '19 07:10 mozartee

我也遇到了

be-water-myFriend avatar Oct 11 '19 12:10 be-water-myFriend

+1

YongTaiSin avatar Oct 16 '19 07:10 YongTaiSin

1.28.4遇到

moxuanyes avatar Dec 23 '19 03:12 moxuanyes

关于pop回来tabBaritem 文字消失的问题.查看一下使用的版本,升级到最新的1.29.0就可以解决了.

100150873 avatar Jul 01 '20 10:07 100150873

1.29.0版本遇到同样问题,按照你们方法设置后文字怎么变成...了? image

haolizi avatar Sep 04 '20 09:09 haolizi

因为其他的Bug.我已经不用这个库了.

------------------ 原始邮件 ------------------ 发件人: "haolizi"<[email protected]>; 发送时间: 2020年9月4日(星期五) 下午5:02 收件人: "ChenYilong/CYLTabBarController"<[email protected]>; 抄送: "鸳鸯语丶"<[email protected]>; "Comment"<[email protected]>; 主题: Re: [ChenYilong/CYLTabBarController] [bug]:xcode11 build 的iOS13下 图片下移或者无法点击 (#439)

1.29.0版本遇到同样问题,按照你们方法设置后文字怎么变成...了?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

100150873 avatar Sep 04 '20 09:09 100150873

你现在用的哪个?

haolizi avatar Sep 04 '20 09:09 haolizi

我自己自定义的.没用三方库

------------------ 原始邮件 ------------------ 发件人: "haolizi"<[email protected]>; 发送时间: 2020年9月4日(星期五) 下午5:07 收件人: "ChenYilong/CYLTabBarController"<[email protected]>; 抄送: "鸳鸯语丶"<[email protected]>; "Comment"<[email protected]>; 主题: Re: [ChenYilong/CYLTabBarController] [bug]:xcode11 build 的iOS13下 图片下移或者无法点击 (#439)

你现在用的哪个?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

100150873 avatar Sep 04 '20 09:09 100150873

那应该是库里,item 的label宽度给写死了吧

------------------ 原始邮件 ------------------ 发件人: "haolizi"<[email protected]>; 发送时间: 2020年9月4日(星期五) 下午5:26 收件人: "ChenYilong/CYLTabBarController"<[email protected]>; 抄送: "鸳鸯语丶"<[email protected]>; "Comment"<[email protected]>; 主题: Re: [ChenYilong/CYLTabBarController] [bug]:xcode11 build 的iOS13下 图片下移或者无法点击 (#439)

找到原因了,只要设置文字大小就会...,比如:normalAttrs[NSFontAttributeName] = [UIFont systemFontOfSize:11]; 不设置就能正常显示

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

100150873 avatar Sep 04 '20 09:09 100150873

image image

haolizi avatar Sep 15 '20 09:09 haolizi

我遇到了这个问题,目前只是找到我项目中不展示tabbarItem的title原因 tabbar.navVC.rootVC 的title不能进行设置,包括 @"" 空字符串,否则就会显示为空。 我项目中这么设置是为了二级返回按钮不展示title。 暂时没有查到具体原因,也实在是没想明白页面的title和tabbar有什么关系

ETListener avatar Dec 12 '20 04:12 ETListener