Hi, I would like to share an issue with the bottom accessory on iPhone Duo (iOS 27.1 beta 1).
When the device is rotated from landscape to portrait and back to landscape, the bottom accessory shrinks and is no longer centered between the edge of the screen and the vertical tab bar.
Steps to reproduce:
- Create
UITabBarControllerwith a regularUIViewset as bottom accessory - Open the app on iPhone Duo in unfolded landscape orientation
- Rotate the device to portrait and back to landscape
- The bottom accessory is smaller than prior to the orientation changes and isn’t centered between the edge of the device and the vertical tab bar anymore
- Set the accessory to nil and back to restore initial width
Expected: Bottom accessory keeps its width across orientation changes
Actual: Width of the bottom accessory changes after orientation changes (landscape -> portrait -> landscape).
I’m using Xcode 27.1 beta and iOS 27.1 beta SDK (24A94403).
I submitted a report via Feedback Assistant, here is the report ID: FB25002243. In the report I attached a minimal reproduction example and a video recording of the bug.
Here is the minimal reproduction example:
// SceneDelegate.swift
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return }
let window = UIWindow(windowScene: windowScene)
window.rootViewController = TabBarControllerWithAccessory()
window.makeKeyAndVisible()
self.window = window
}
}
// TabBarControllerWithAccessory.swift
import UIKit
class TabBarControllerWithAccessory: UITabBarController {
override func viewDidLoad() {
super.viewDidLoad()
tabs = [
UITab(title: "First", image: UIImage(systemName: "1.circle"), identifier: "first") { _ in ScreenViewController() },
UITab(title: "Second", image: UIImage(systemName: "2.circle"), identifier: "second") { _ in ScreenViewController() },
]
bottomAccessory = UITabAccessory(contentView: AccessoryContentView())
}
}
class ScreenViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .systemBackground
let mountButton = UIButton(configuration: .filled(), primaryAction: UIAction(title: "Mount") { [weak self] _ in
self?.tabBarController?.bottomAccessory = UITabAccessory(contentView: AccessoryContentView())
})
let unmountButton = UIButton(configuration: .filled(), primaryAction: UIAction(title: "Unmount") { [weak self] _ in
self?.tabBarController?.bottomAccessory = nil
})
let stackView = UIStackView(arrangedSubviews: [mountButton, unmountButton])
stackView.axis = .vertical
stackView.spacing = 16
stackView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(stackView)
NSLayoutConstraint.activate([
stackView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
stackView.centerYAnchor.constraint(equalTo: view.centerYAnchor),
])
}
}
class AccessoryContentView: UIView {
private let widthLabel = UILabel()
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .systemOrange
widthLabel.translatesAutoresizingMaskIntoConstraints = false
addSubview(widthLabel)
NSLayoutConstraint.activate([
widthLabel.centerXAnchor.constraint(equalTo: centerXAnchor),
widthLabel.centerYAnchor.constraint(equalTo: centerYAnchor),
])
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func layoutSubviews() {
super.layoutSubviews()
let text = "\(bounds.width)"
if widthLabel.text != text {
widthLabel.text = text
}
}
}
Before:
After:
Thank you in advance!