UIToolbar background extension doesn't automatically adjust for safe area changes

Originator:zach
Number:rdar://47966034 Date Originated:February 11 2019, 11:53 AM
Status:Open Resolved:false
Product:iOS + SDK Product Version:iOS 12.1.3 / Xcode Version 10.1 (10B61)
Classification:Other Bug Reproducible:Always
 
Area:
UIKit

Summary:



Steps to Reproduce:

1. Open attached sample project "Safely".
2. Build and run "Safely" scheme on any iOS simulator or device that has non-zero safe areas.
3. Tap to activate the text field at the top of the screen.
4. Hide the software keyboard, either using the simulator or by connecting a hardware keyboard to a device.
5. Rotate the device.
6. Observe.

Expected Results:

The toolbar extends its background into the safe area. Upon rotation, that extension updates for the new safe area.

Actual Results:

The toolbar extends its background into the safe area. Upon rotation, that extension disappears. See attached screenshot.

Workaround: Respond to `UIInputViewController.viewSafeAreaInsetsDidChange()` to call `toolbar.setNeedsLayout()`.

Side note: Even with this specific issue addressed, the toolbar does not behave like other system controls intended to abut the edge of the screen. That it "extends" its background outside of its bounds instead its contents avoiding safe area is perplexing.

Version/Build:

Xcode Version 10.1 (10B61)
iOS 12.1.3 

Configuration:

N/A

Comments

Attachments:

  • https://www.icloud.com/iclouddrive/0yGZkVJljFQJMrSycQUdndGUA#Safely
  • https://www.icloud.com/iclouddrive/0uVzsnjflEL-yV5y7MMy0m9xg#Simulator_Screen_Shot_-_iPhone_Xs_Max_-_2019-02-11_at_11.43

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!