Why page Push animation Tabbar moving up in the iPhone X

后端 未结 7 1463
不知归路
不知归路 2020-12-02 11:00

I build a app Demo, use hidesBottomBarWhenPushed hide Tabbar in Push Animation.

\"Page

B

7条回答
  •  执笔经年
    2020-12-02 11:18

    i'll provide another solution for this bug(seems apple made).

    and the solution is not to forbid the tabbar move up , but to make the black area will not show when tabbar move up

    the core thing is add a subview to your viewcontroller as it deepest subview and this subview's frame is the window size.so when the tabbar moves up , this subview will shown insteadof black area

    if (@available(iOS 11.0, *)) {
        UIView* bgView = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];
        bgView.autoresizingMask = UIViewAutoresizingNone;
        bgView.backgroundColor = UIColorFromRGB(0xefeff4);
        [self.view addSubview:bgView];
    
    }
    

    the convenience of this method is you will not have to subclass tabbar or overwrite navigationcontroller's push method

提交回复
热议问题