Hi--
I have a tab bar to navigate my app; each page I use auto layout on them. I have a couple pages which have a Toolbar to help inner navigations, which are autolayouted to be pinned to the bottom of the page. On all IOS devices I've played with so far, the toolbar is sitting nicely at the top of the tabs -- however, on the iPhone X emulator, I see the toolbar about 5px and the rest of it is under the toolbar.
The designer view:
vs the emulator:
Any thoughts on working around this? Or is it just an emulator issue? Thanks!
Eric
constraints == Auto Layout
You need to switch to using auto layout if you want stuff like this to work correctly.
Answers
I assume you are using UITabBarController. Is your tabbar set to translucent?
TabBar.Translucent = false;
If you have a sample project, I'll take a quick look.
Hi--
To be clear, the layout depicted in the picture only occurs on the IPhone X -- on every other device and emulator I've tried, it looks just like the XCode preview. I'll take a look at the Translucent property to see how usable that is but I suspect it wont be ideal. Thanks.
Eric
Hi--
I wouldn't have expected that
-- but unfortunately, that didn't change anything for me. Basically instead of the gray colour for the toolbar, it is now a white in the same position. Thanks for the suggestion though.
Eric
Can you whip together a sample that illustrates the issue?
Hi--
Sure, here is a sample: https://bitbucket.org/etheriau/xamarinstoryboardtest that reproduces the issue. In doing that sample, I think one answer to avoid this is to not use a custom Toolbar, however, it is still strange that auto-layout works the way it did. Let me know if you have any insight. Thanks.
Eric
@EricTheriault Needing a distraction I whipped together a sample app that seems to work correctly.
I don't see any constraints on your toolbar.
Hi--
I'm using auto layout which I thought was not compatible with constraints?
Eric
constraints == Auto Layout
You need to switch to using auto layout if you want stuff like this to work correctly.
Hi--
Thanks for the clarification -- I didn't realize that Auto Resize was a different beast all together. I will take a look into this. Thanks so much!
Eric
Yea, auto resizing masks is old tech. You should stick with auto layout so you can do things like constraint to top and bottom layout guides which is what fixes your problem.