【问题标题】:Tabbar background image transparent become white标签栏背景图片透明变白
【发布时间】:2014-09-25 16:57:59
【问题描述】:

我通过创建背景图像创建了一个自定义标签栏,然后在我的 appDelegate 中使用了此代码

UITabBar *tabBar = [UITabBar appearance];
tabBar.backgroundImage = [UIImage imageNamed:@"tabbar"];

图片

圆顶周围的颜色都是透明的,但是在应用程序中它会自动将其变为白色,因此在滚动时它在 tableview 中看起来不太好。我可以在 ios 中保持透明吗?

我旁边唯一的标签栏代码如下

[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil]
 setTitleTextAttributes:
 @{NSForegroundColorAttributeName:[UIColor whiteColor],
   NSFontAttributeName:[UIFont fontWithName:@"Lato-Regular" size:18]
   }
 forState:UIControlStateNormal];

【问题讨论】:

    标签: ios objective-c uitabbar


    【解决方案1】:

    您可以将标签栏的 translucent 属性设置为 false 来解决此问题。

    您可以使用故事板中的检查器或通过代码进行设置:

    tabBarController.tabBar.translucent = NO;
    

    希望对你有帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-09-16
      • 2011-09-24
      • 1970-01-01
      • 1970-01-01
      • 2013-08-16
      • 2011-10-01
      • 1970-01-01
      相关资源
      最近更新 更多