When I turn on personal hot spot connection, my layout gets pushed down. How can I either remove this hot spot bar at the top or get a notification for this bar and rearrange my view according to it? Thanks.
When the size of your status bar changes, your application delegate method is called. All you have to do is handle that selector and update your view manually (if autoresizing isn't something you would go with). Here's what you need to add to your app delegate:
- (void)application:(UIApplication *)application didChangeStatusBarFrame (CGRect)oldStatusBarFrame
{
// update layout here
}
However, as @sosborn has mentioned, it might be a lot simpler to make sure that your views and subviews have autoresizing (aka springs and struts) set correctly (either in code or through the interface builder).
One last note: you can always query for the status bar frame (and therefore size) by calling: [[UIApplication sharedApplication] statusBarFrame]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With