-
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
swift下加号无法显示 #226
Comments
我也出现了这个问题 |
从1.17.4版本起,需要通过规定的初始化方法来进行初始化, 比如下面的系列初始化方法: - (instancetype)initWithViewControllers:(NSArray<UIViewController *> *)viewControllers
tabBarItemsAttributes:(NSArray<NSDictionary *> *)tabBarItemsAttributes;
+ (instancetype)tabBarControllerWithViewControllers:(NSArray<UIViewController *> *)viewControllers
tabBarItemsAttributes:(NSArray<NSDictionary *> *)tabBarItemsAttributes;
- (instancetype)initWithViewControllers:(NSArray<UIViewController *> *)viewControllers
tabBarItemsAttributes:(NSArray<NSDictionary *> *)tabBarItemsAttributes
imageInsets:(UIEdgeInsets)imageInsets
titlePositionAdjustment:(UIOffset)titlePositionAdjustment;
+ (instancetype)tabBarControllerWithViewControllers:(NSArray<UIViewController *> *)viewControllers
tabBarItemsAttributes:(NSArray<NSDictionary *> *)tabBarItemsAttributes
imageInsets:(UIEdgeInsets)imageInsets
titlePositionAdjustment:(UIOffset)titlePositionAdjustment;
- (instancetype)initWithViewControllers:(NSArray<UIViewController *> *)viewControllers
tabBarItemsAttributes:(NSArray<NSDictionary *> *)tabBarItemsAttributes
imageInsets:(UIEdgeInsets)imageInsets
titlePositionAdjustment:(UIOffset)titlePositionAdjustment
context:(NSString *)context;
+ (instancetype)tabBarControllerWithViewControllers:(NSArray<UIViewController *> *)viewControllers
tabBarItemsAttributes:(NSArray<NSDictionary *> *)tabBarItemsAttributes
imageInsets:(UIEdgeInsets)imageInsets
titlePositionAdjustment:(UIOffset)titlePositionAdjustment
context:(NSString *)context;
现在仓库里的swift-demo还未更新,稍后会更新。 |
另外也欢迎帮忙修改下仓库里的swift demo,提一个pr。 |
@ChenYilong 多谢指点,仓库里的Swift版本有点老了,最新写了个https://github.com/WeMadeCode/CYLTabBarController-Swift |
@WeMadeCode 十分感谢,另外你再检查下你的demo,截止你的第三个 commit :18355f87e99bb09f1b5ebd10ddd11b451c129ffc demo无法这个正常运行,pod install也是失败的,请检查target name设置是否与podfile 里的设置能够匹配。 |
@ChenYilong Sorry 由于我修改工程名的操作,造成了这个问题 |
@WeMadeCode 已经采纳,并在文档中进行了署名,感谢。我的仓库中也已经上传了你的 最新版 ,代码未做修改,欢迎验证下我仓库中的版本是否属于你的预期。后期如果你这边有更新的话,欢迎提PR,再次表示感谢。 |
@ChenYilong 非常感谢 我以后将继续学习CYLTabBarController,并将提交更多的Swift版本功能 |
@ChenYilong 那么StoryBoard创建的怎么初始化呢 |
我也遇到一样的疑问,“那么StoryBoard创建的怎么初始化呢?” |
同样的问题,请问通过StoryBoard创建的有没有办法解决? |
自行解决,在Storyboard连接的类里的viewDidLoad(),我加入了以下的代码
|
Storyboard的tabbar在图形界面也可以自定义归属类 |
应该说,在Storyboard指定tabBarController的归属类后,不会调用任何init方法,而跟plusButton相关的逻辑我看到放在了setContext里面,如果是用Storyboard创建是不会调用这个方法的 |
多谢提供解决方案 |
Base Info for this issue
1. How to repeat the problem.
中间的plus按钮无法显示
2. Please help me in this way.
swift使plus按钮正常显示
3. Here is a Demo.
通过邮箱发送demo
4. Here is my Debug log
The text was updated successfully, but these errors were encountered: