Post

Replies

Boosts

Views

Activity

Reply to Fix text in accessory view
I attempted to reproduce the bug in UIKit, but it works correctly there. Notice how the Tab Bar and the accessory view change color simultaneously. final class ViewController: UITabBarController { override func viewDidLoad() { super.viewDidLoad() let firstVC = FirstTabVC() firstVC.tabBarItem = UITabBarItem( title: "first", image: UIImage(systemName: "1.circle"), tag: 0 ) let secondVC = SecondTabVC() secondVC.tabBarItem = UITabBarItem( title: "second", image: UIImage(systemName: "2.circle"), tag: 1 ) viewControllers = [firstVC, secondVC] setupBottomAccessory() } func setupBottomAccessory() { let titleLabel = UILabel() titleLabel.text = "Title" let iconView = UIImageView(image: UIImage(systemName: "play.fill")) iconView.preferredSymbolConfiguration = .init(pointSize: 20, weight: .semibold) iconView.tintColor = .label iconView.contentMode = .scaleAspectFit let stackView = UIStackView(arrangedSubviews: [titleLabel, iconView]) stackView.translatesAutoresizingMaskIntoConstraints = false let accessoryView = UIView() accessoryView.addSubview(stackView) NSLayoutConstraint.activate([ accessoryView.heightAnchor.constraint(equalToConstant: 48), stackView.topAnchor.constraint(equalTo: accessoryView.topAnchor), stackView.leadingAnchor.constraint(equalTo: accessoryView.leadingAnchor, constant: 16), stackView.trailingAnchor.constraint(equalTo: accessoryView.trailingAnchor, constant: -16), stackView.bottomAnchor.constraint(equalTo: accessoryView.bottomAnchor), ]) bottomAccessory = UITabAccessory(contentView: accessoryView) } } private final class FirstTabVC: UIViewController { private let scrollView = UIScrollView() private let contentView = UIView() private let topSpacer = UIView() private let gradientView = GradientView() override func viewDidLoad() { super.viewDidLoad() scrollView.translatesAutoresizingMaskIntoConstraints = false contentView.translatesAutoresizingMaskIntoConstraints = false topSpacer.translatesAutoresizingMaskIntoConstraints = false gradientView.translatesAutoresizingMaskIntoConstraints = false view.addSubview(scrollView) scrollView.addSubview(contentView) contentView.addSubview(topSpacer) contentView.addSubview(gradientView) NSLayoutConstraint.activate([ scrollView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor), scrollView.leadingAnchor.constraint(equalTo: view.leadingAnchor), scrollView.trailingAnchor.constraint(equalTo: view.trailingAnchor), scrollView.bottomAnchor.constraint(equalTo: view.bottomAnchor), contentView.topAnchor.constraint(equalTo: scrollView.contentLayoutGuide.topAnchor), contentView.leadingAnchor.constraint(equalTo: scrollView.contentLayoutGuide.leadingAnchor), contentView.trailingAnchor.constraint(equalTo: scrollView.contentLayoutGuide.trailingAnchor), contentView.bottomAnchor.constraint(equalTo: scrollView.contentLayoutGuide.bottomAnchor), contentView.widthAnchor.constraint(equalTo: scrollView.frameLayoutGuide.widthAnchor), topSpacer.topAnchor.constraint(equalTo: contentView.topAnchor), topSpacer.leadingAnchor.constraint(equalTo: contentView.leadingAnchor), topSpacer.trailingAnchor.constraint(equalTo: contentView.trailingAnchor), topSpacer.heightAnchor.constraint(equalToConstant: 800), gradientView.topAnchor.constraint(equalTo: topSpacer.bottomAnchor), gradientView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor), gradientView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor), gradientView.heightAnchor.constraint(equalToConstant: 800), gradientView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor) ]) } } private final class SecondTabVC: UIViewController { } private final class GradientView: UIView { override class var layerClass: AnyClass { CAGradientLayer.self } override init(frame: CGRect) { super.init(frame: frame) let layer = layer as! CAGradientLayer layer.colors = [UIColor.systemYellow.cgColor, UIColor.black.cgColor] layer.startPoint = CGPoint(x: 0.5, y: 0.0) layer.endPoint = CGPoint(x: 0.5, y: 1.0) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } }
Topic: UI Frameworks SubTopic: SwiftUI
Feb ’26
Reply to Fix text in accessory view
Thank you for taking a look. While you could argue that hard scroll edge fixes this issue, it actually looks terrible and defeats the whole purpose of Liquid Glass. Here's how it would look like in real app and not trivial solid color background example. soft (including illegible text bug): hard:
Topic: UI Frameworks SubTopic: SwiftUI
Feb ’26
Reply to Fix text in accessory view
FB21365706 It looks like the tabViewBottomAccessory view doesn’t adapt properly when the background isn’t white. Interestingly, the tab bar itself adapts perfectly. struct ContentView: View { enum TabValue: String { case first, second } @State var selectedTab: TabValue = .first var body: some View { TabView(selection: $selectedTab) { Tab("first", systemImage: "1.circle", value: .first) { ScrollView(.vertical) { Spacer(minLength: 800) LinearGradient( colors: [.yellow, .black], startPoint: .top, endPoint: .bottom ) .frame(height: 800) } } Tab("second", systemImage: "2.circle", value: .second) { } } .tabViewBottomAccessory { HStack { Text("Title") Spacer() Image(systemName: "play.fill") } .padding(.horizontal) } } }
Topic: UI Frameworks SubTopic: SwiftUI
Dec ’25
Reply to Fix text in accessory view
FB21365706 All reproducible code samples and screen recordings showing the issue are attached.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Feb ’26
Reply to Fix text in accessory view
I attempted to reproduce the bug in UIKit, but it works correctly there. Notice how the Tab Bar and the accessory view change color simultaneously. final class ViewController: UITabBarController { override func viewDidLoad() { super.viewDidLoad() let firstVC = FirstTabVC() firstVC.tabBarItem = UITabBarItem( title: "first", image: UIImage(systemName: "1.circle"), tag: 0 ) let secondVC = SecondTabVC() secondVC.tabBarItem = UITabBarItem( title: "second", image: UIImage(systemName: "2.circle"), tag: 1 ) viewControllers = [firstVC, secondVC] setupBottomAccessory() } func setupBottomAccessory() { let titleLabel = UILabel() titleLabel.text = "Title" let iconView = UIImageView(image: UIImage(systemName: "play.fill")) iconView.preferredSymbolConfiguration = .init(pointSize: 20, weight: .semibold) iconView.tintColor = .label iconView.contentMode = .scaleAspectFit let stackView = UIStackView(arrangedSubviews: [titleLabel, iconView]) stackView.translatesAutoresizingMaskIntoConstraints = false let accessoryView = UIView() accessoryView.addSubview(stackView) NSLayoutConstraint.activate([ accessoryView.heightAnchor.constraint(equalToConstant: 48), stackView.topAnchor.constraint(equalTo: accessoryView.topAnchor), stackView.leadingAnchor.constraint(equalTo: accessoryView.leadingAnchor, constant: 16), stackView.trailingAnchor.constraint(equalTo: accessoryView.trailingAnchor, constant: -16), stackView.bottomAnchor.constraint(equalTo: accessoryView.bottomAnchor), ]) bottomAccessory = UITabAccessory(contentView: accessoryView) } } private final class FirstTabVC: UIViewController { private let scrollView = UIScrollView() private let contentView = UIView() private let topSpacer = UIView() private let gradientView = GradientView() override func viewDidLoad() { super.viewDidLoad() scrollView.translatesAutoresizingMaskIntoConstraints = false contentView.translatesAutoresizingMaskIntoConstraints = false topSpacer.translatesAutoresizingMaskIntoConstraints = false gradientView.translatesAutoresizingMaskIntoConstraints = false view.addSubview(scrollView) scrollView.addSubview(contentView) contentView.addSubview(topSpacer) contentView.addSubview(gradientView) NSLayoutConstraint.activate([ scrollView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor), scrollView.leadingAnchor.constraint(equalTo: view.leadingAnchor), scrollView.trailingAnchor.constraint(equalTo: view.trailingAnchor), scrollView.bottomAnchor.constraint(equalTo: view.bottomAnchor), contentView.topAnchor.constraint(equalTo: scrollView.contentLayoutGuide.topAnchor), contentView.leadingAnchor.constraint(equalTo: scrollView.contentLayoutGuide.leadingAnchor), contentView.trailingAnchor.constraint(equalTo: scrollView.contentLayoutGuide.trailingAnchor), contentView.bottomAnchor.constraint(equalTo: scrollView.contentLayoutGuide.bottomAnchor), contentView.widthAnchor.constraint(equalTo: scrollView.frameLayoutGuide.widthAnchor), topSpacer.topAnchor.constraint(equalTo: contentView.topAnchor), topSpacer.leadingAnchor.constraint(equalTo: contentView.leadingAnchor), topSpacer.trailingAnchor.constraint(equalTo: contentView.trailingAnchor), topSpacer.heightAnchor.constraint(equalToConstant: 800), gradientView.topAnchor.constraint(equalTo: topSpacer.bottomAnchor), gradientView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor), gradientView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor), gradientView.heightAnchor.constraint(equalToConstant: 800), gradientView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor) ]) } } private final class SecondTabVC: UIViewController { } private final class GradientView: UIView { override class var layerClass: AnyClass { CAGradientLayer.self } override init(frame: CGRect) { super.init(frame: frame) let layer = layer as! CAGradientLayer layer.colors = [UIColor.systemYellow.cgColor, UIColor.black.cgColor] layer.startPoint = CGPoint(x: 0.5, y: 0.0) layer.endPoint = CGPoint(x: 0.5, y: 1.0) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } }
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Feb ’26
Reply to Fix text in accessory view
Thank you for taking a look. While you could argue that hard scroll edge fixes this issue, it actually looks terrible and defeats the whole purpose of Liquid Glass. Here's how it would look like in real app and not trivial solid color background example. soft (including illegible text bug): hard:
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Feb ’26
Reply to tabViewBottomAccessory in 26.1: View's @State is lost when switching tabs
Still an issue on iOS 26.4 Beta 1. FB21364908
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Feb ’26
Reply to Fix text in accessory view
Still not fixed on iOS 26.4 Beta 1. FB21365706
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Feb ’26
Reply to Fix text in accessory view
FB21365706 It looks like the tabViewBottomAccessory view doesn’t adapt properly when the background isn’t white. Interestingly, the tab bar itself adapts perfectly. struct ContentView: View { enum TabValue: String { case first, second } @State var selectedTab: TabValue = .first var body: some View { TabView(selection: $selectedTab) { Tab("first", systemImage: "1.circle", value: .first) { ScrollView(.vertical) { Spacer(minLength: 800) LinearGradient( colors: [.yellow, .black], startPoint: .top, endPoint: .bottom ) .frame(height: 800) } } Tab("second", systemImage: "2.circle", value: .second) { } } .tabViewBottomAccessory { HStack { Text("Title") Spacer() Image(systemName: "play.fill") } .padding(.horizontal) } } }
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Dec ’25
Reply to tabViewBottomAccessory in 26.1: View's @State is lost when switching tabs
Still an issue on iOS 26.3 Beta 1. FB21364908
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’25