iOS UITabBar : Remove top shadow gradient line

前端 未结 15 1279
暖寄归人
暖寄归人 2020-12-02 08:59

I implemented a custom UITabBar and I still have this gradient/shadow on top of it. I added

[self.tabBar setBackgroundImage:[UIImage imageNamed:@\"navBarBotto

15条回答
  •  -上瘾入骨i
    2020-12-02 09:51

    Similary in answer for this question ... if You don't want to mess with any kind of 1x1 transparent image, this work's too:

    [[UITabBar appearance] setBackgroundImage:[[UIImage alloc] init]]; 
    [[UITabBar appearance] setShadowImage:[[UIImage alloc] init]];
    

    In swift:

    UITabBar.appearance().shadowImage = UIImage()
    UITabBar.appearance().backgroundImage = UIImage()
    

提交回复
热议问题