Commit b253b22b authored by Alex朱枝文's avatar Alex朱枝文

适配使得底部tabbar满足条件

parent 1916c02b
......@@ -42,6 +42,24 @@ class YHTabBarViewController: ESTabBarController {
shareView.frame = self.tabBar.frame
view.addSubview(shareView)
if UIDevice.current.userInterfaceIdiom == .pad {
if #available(iOS 18.0, *) {
traitOverrides.horizontalSizeClass = .compact
// if let classType = NSClassFromString("_UITabContainerView"), let view = view.subviews.first(where: { $0.isKind(of: classType) }) {
// view.isHidden = true
// }
// 2. 遍历子视图,找到可能是 _UITabContainerView 的视图
for subview in view.subviews {
let className = String(describing: type(of: subview))
if className.contains("TabContainer") { // 模糊匹配类名
subview.isHidden = true // 或其他操作
break
}
}
view.addSubview(tabBar)
}
}
shareView.block = { tag in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment