
Мне нужен тот же цвет, что и в App Store. Градиент, цвет фона, выбранный цвет и невыбранный цвет одинаковы.
переопределить func viewWillAppear(_ Animated: Bool) { super.viewWillAppear(анимированный) tabBar.barTintColor = .clear UITabBarItem.appearance().setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.lightGray.withAlphaComponent(0.5)], for: .normal) UITabBarItem.appearance().setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.white.withAlphaComponent(0.7)], for: .selected) если #available(iOS 13.0, *) { вар внешний вид = tabBar.standardAppearance // Устанавливаем более прозрачный фон с эффектом размытия внешний вид.backgroundEffect = UIBlurEffect(стиль: .systemMaterial) // Устанавливаем цвета элементов панели вкладок setTabBarItemColors(appearance.stackedLayoutAppearance) setTabBarItemColors(appearance.inlineLayoutAppearance) setTabBarItemColors(appearance.compactInlineLayoutAppearance) // Устанавливаем внешний вид значка элемента панели вкладок setTabBarItemBadgeAppearance(appearance.stackedLayoutAppearance) setTabBarItemBadgeAppearance(appearance.inlineLayoutAppearance) setTabBarItemBadgeAppearance(appearance.compactInlineLayoutAppearance) tabBar.standardAppearance = внешний вид } еще { // Резервный вариант для более ранних версий iOS, если необходимо } } @доступно(iOS 13.0, *) частная функция setTabBarItemColors (_ itemAppearance: UITabBarItemAppearance) { // Устанавливаем цвета для нормального и выбранного состояний itemAppearance.normal.iconColor = .systemGray itemAppearance.normal.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.systemGray.withAlphaComponent(0.5)] itemAppearance.selected.iconColor = .label itemAppearance.selected.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.label.withAlphaComponent(0.7)] } @доступно(iOS 13.0, *) частная функция setTabBarItemBadgeAppearance (_ itemAppearance: UITabBarItemAppearance) { // Установка цвета фона значка, цвета текста и настройки положения itemAppearance.normal.badgeBackgroundColor = .systemRed itemAppearance.normal.badgeTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white] itemAppearance.normal.badgePositionAdjustment = UIOffset(по горизонтали: 1, по вертикали: -1) } Мне нужна панель вкладок, как в магазине приложений, но с помощью этого кода я ее получаю.

Мобильная версия