Reputation: 18351
Is there a trick to detecting when the status bar changes height due to a phone call in Xamarin.iOS?
I'm trying to adapt the excellent instructions from this post to work in Xamarin, and the ChangedStatusBarFrame
method is never called.
The following code doesn't do anything in a brand new Xamarin iPhone project:
public virtual void ChangedStatusBarFrame(UIApplication application, RectangleF oldStatusBarFrame)
{
Debug.WriteLine("Y U NO work!");
}
I tried the equivalent in a new native iPhone app and it worked perfectly:
- (void)application:(UIApplication *)application didChangeStatusBarFrame:(CGRect)oldStatusBarFrame
{
NSLog(@"Hey, the status bar changed size!");
}
I'm testing this on the iOS simulator by toggling the status bar.
I'm using Xamarin.iOS version 6.4.3.0 and XCode 4.6.3.
Any suggestions?
Upvotes: 3
Views: 843
Reputation: 5575
You should use override keyword:
public override void ChangedStatusBarFrame(UIApplication application, RectangleF oldStatusBarFrame)
{
Debug.WriteLine("Y U NO work!");
}
Upvotes: 3