Post

Replies

Boosts

Views

Activity

UIBarButtonItem instances with custom views do not render correctly within the overflow menu of UIToolbar
var items: [UIBarButtonItem] = [] for i in 0...10 { let button = UIButton() button.setTitle("Hello \(i)", for: .normal) button.setTitleColor(.black, for: .normal) let item = UIBarButtonItem(customView: button) items.append(item) } self.setToolbarItems(items, animated: true)When a UIToolbar contains many items, an overflow button appears. If a bar button item is created with a custom view, it cannot be rendered properly in the overflow menu. However, if the item is created using an initializer such as UIBarButtonItem(image:style:target:action:) or UIBarButtonItem(title:style:target:action:), the overflow menu displays it correctly. Environment: iOS 27.0
Topic: UI Frameworks SubTopic: UIKit
0
0
24
2d
UIBarButtonItem instances with custom views do not render correctly within the overflow menu of UIToolbar
var items: [UIBarButtonItem] = [] for i in 0...10 { let button = UIButton() button.setTitle("Hello \(i)", for: .normal) button.setTitleColor(.black, for: .normal) let item = UIBarButtonItem(customView: button) items.append(item) } self.setToolbarItems(items, animated: true)When a UIToolbar contains many items, an overflow button appears. If a bar button item is created with a custom view, it cannot be rendered properly in the overflow menu. However, if the item is created using an initializer such as UIBarButtonItem(image:style:target:action:) or UIBarButtonItem(title:style:target:action:), the overflow menu displays it correctly. Environment: iOS 27.0
Topic: UI Frameworks SubTopic: UIKit
Replies
0
Boosts
0
Views
24
Activity
2d