【问题标题】:How do I fully customise TabBar in iOS如何在 iOS 中完全自定义 TabBar
【发布时间】:2017-02-01 06:51:59
【问题描述】:

我需要在我的 iOS 应用程序中自定义TabBar,如图所示

我需要更改背景颜色、未选择的图像色调颜色和选择的图像色调颜色。这是怎么做到的

【问题讨论】:

  • 你试过这个link

标签: ios swift swift3 uitabbar uitabbaritem


【解决方案1】:

为此,您需要设置UITaBbarbarTintColortintColor 属性。

self.tabBarController?.tabBar.barTintColor = .blue //Background Color
self.tabBarController?.tabBar.tintColor = .yellow //Selected Item tint color

注意:如果你有两个状态的图像意味着默认和选择,然后设置两个图像的集合,检查this answer为标签栏项目设置选定的图像。现在将两个图像的Render mode 设置为资产中的Original Image,如果您不知道如何设置检查this answer

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-10-11
    • 2012-10-28
    • 1970-01-01
    • 2019-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多