This repository has been archived by the owner on Jan 23, 2020. It is now read-only.
Fix frame when system status bar is hidden
Pre-release
Pre-release
When the system status bar is hidden, UIApplication.shared.statusBarFrame
returns a zero frame.
VolumeBar sets the internal frame of its window and view when start
is called. Since it previously used UIApplication.shared.statusBarFrame
, which could be zero when start
is called, this could cause an incorrect layout. Now we use UIScreen.main.bounds
instead (and wrap all layout parameters in abs
just in case).
We can't use UIApplication.shared.keyWindow?.bounds
because the VolumeBar might be started before the key window is available. Note that the use of UIScreen.main.bounds
won't work on iPad in split-screen, but VolumeBar doesn't currently work on iPad at all.