Reputation: 186
I have an iPad app written in objective-c that has a tool bar at the bottom of a UIVew.
In ios10, the bar sits at the absolute bottom of the screen, and I then place images, streams, etc above that bar and extending to just above the bar.
In ios11, the bar appears to be about 20px ABOVE the absolute bottom, and therefore, my images encroach upon the top of the bar.
I believe this is the "safe area" that was introduced in ios11.
Is there any way I can account for this and have the same functionality in both ios10 AND ios11/12?
edit: in the attached image, the left simulator is ios12, and the right simulator is ios10.
You can see there is black under the ios12 bar, and the image cuts down into the toolbar. In the right simulator, that is not the case. No mods to the code...
Upvotes: 0
Views: 79
Reputation: 4803
Yes you can achieve this by directly setting bottom constraint 0 to superview instead of bottom constraint to safe area layout. If you are using older version of Xcode ans iOS, then it will be Bottom Layout Guide
instead of Bottom Safe Area
In above image you can see space at bottom.
Here it is, what you want. But now I suggest to check once. If you are using Xcode 10
and above, then please enable device bezels and chk what happened.
Now you can see in above image, all messed up. So It is better if you redesign layout and make circle little small, so circle image won't be cut behind toolbar. And if you need to change anything in future then you just need little changes.
Upvotes: 1