我是iOS的新手。我想在CarbonTabSwipeNavigation上应用渐变颜色。我尝试将渐变应用于CarbonTabSwipeNavigation的工具栏,但未成功。我已经尝试使用静态颜色代码。
carbonTabSwipeNavigation.toolbar.isTranslucent = true
var color1 = hexStringToUIColor(hex: "#00275E")
carbonTabSwipeNavigation.carbonSegmentedControl?.backgroundColor = color1
carbonTabSwipeNavigation.setIndicatorColor(UIColor.white) //tabBar font
carbonTabSwipeNavigation.setSelectedColor(UIColor.white, font: UIFont.boldSystemFont(ofSize: 14))