Skip to content
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

[bug]:iPadOS 18 上 无法设置tabbar到底部 #615

Open
MrDangerous opened this issue Sep 20, 2024 · 12 comments
Open

[bug]:iPadOS 18 上 无法设置tabbar到底部 #615

MrDangerous opened this issue Sep 20, 2024 · 12 comments
Assignees
Labels

Comments

@MrDangerous
Copy link

在CYLTabBarController.m中 添加如下代码

  • (void)viewDidLoad {
    [super viewDidLoad];
    if (@available(iOS 18.0, *))
    {
    if (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad)
    {
    self.traitOverrides.horizontalSizeClass = UIUserInterfaceSizeClassCompact; //TAB BAR ON BOTTOM

      }
    

    }
    }
    无法生效,而且tabitem 消失不见

@WolfMobileDev
Copy link

请问这个解决了吗

@MrDangerous
Copy link
Author

没有解决

@WolfMobileDev
Copy link

那你们现在咋处理的,我也遇到了,根据你写的方法,下面tabitem 直接消失不见

@MrDangerous
Copy link
Author

换库吧 这都没人维护了

@Jsh505
Copy link

Jsh505 commented Oct 17, 2024

暂时降级xcode打包解决审核问题,不清楚后面苹果会不会开放类似关闭的api

@iOSleep
Copy link

iOSleep commented Oct 21, 2024

自己找找类里重写的tabbar 然后设置上去 类似

if (@available(iOS 18.0, *)) {
        if (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
            self.mode = UITabBarControllerModeTabBar;
            self.traitOverrides.horizontalSizeClass = UIUserInterfaceSizeClassCompact;
            [self.view addSubview:self.replaceTabbar];
        }
}

18的api改了,替换上去不生效,☀️🐶

@Jsh505
Copy link

Jsh505 commented Oct 21, 2024

不是太明白你这个 [self.view addSubview:self.replaceTabbar];
直接在 CYLTabBarController 的viewDidLoad 中尝试你上面这样处理底部只有一个空白的tabbar显示

@ff-jackma
Copy link

尝试修复了下:https://github.com/ff-jackma/CYLTabBarController

@Jsh505
Copy link

Jsh505 commented Oct 22, 2024

好像还是有点问题。显示一下然后会自动隐藏

@ff-jackma
Copy link

好像还是有点问题。显示一下然后会自动隐藏

我这里没问题,可能其他地方的代码把_UITabContainerView这个视图显示出来了,挡住了手动add 的 tabbar

@Jsh505
Copy link

Jsh505 commented Oct 22, 2024

确实可以了。另一个项目没问题

@Bo0628
Copy link

Bo0628 commented Dec 23, 2024

好像还是有点问题。显示一下然后会自动隐藏

我这里没问题,可能其他地方的代码把_UITabContainerView这个视图显示出来了,挡住了手动add 的 tabbar

_UITabContainerView本身就是用来作为TabBar父视图的, 为啥要隐藏...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants