Toolbar automatic hight resizing problem

Hello iOS developers,


I have problem with positioning Toolbar and setting it's constrains properly. When I have Toolbar set with single constrain Safe Area.bottom = Toolbar.bottom it is positioned as desired at the bottom of the screen and keeps its automatic height 44 like on the picture:



But of course it complains that Toolbar "Need constrains for: X position, width"


When I add 2 more constrains for Toolbar.leading = Safe Area.leading and Toolbar.trailing = Safe Area.trailing it will resolve Auto Layout issue with X position and width, but will also resize Toolbar's automatic height to 49, which makes now height of Toolbar to appear not symmetrical with its Item no more vertically aligned to the Center, as follows:



Does anyone please, have an idea why this happens? Or how to get a rid of it?


Of course, I can put another constrain to Toolbar height = 44 and it will resolve wrong appearance of the Toolbar, but I don't think it's really correct, because I don't see reason for Toolbar to change it's automatic height when its x position is set?


Is this a bug in Xcode Interface Builder or am I doing something wrong?


Thanks and have great day, everyone.


MacBook Pro 15", macOS 10.15

Posted on Apr 5, 2020 4:31 AM

Reply
1 reply

Apr 8, 2020 8:08 AM in response to Manolis_from_Prague

Update:


I found out basically the issue described in initial post does not affect iPhone models 8 and below (those with home button).


Unfortunately affected are iPhones with FaceID, from iPhone X above, including all traits iPhone 11.


I'm not changing anything in layout in Interface Builder, all the constrains remain in place, the only change is View as: iPhone 11 and that is enough to trigger the issue.


I was thinking maybe it's Interface Builder bug only, but unfortunately the issue is also compiled into the target both to Simulator or physical device.


Pretty suer it's bug in Xcode, have filled report already, have great day everyone, bye.


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Toolbar automatic hight resizing problem

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.