На самом деле строка состояния является полупрозрачной.
- (void)webViewDidFinishLoad:(UIWebView *)theWebView
{
// only valid if StatusBarTtranslucent.plist specifies a protocol to handle
if(self.invokeString)
{
// this is passed before the deviceready event is fired, so you can access it in js when you receive deviceready
NSString* jsString = [NSString stringWithFormat:@"var invokeString = \"%@\";", self.invokeString];
[theWebView stringByEvaluatingJavaScriptFromString:jsString];
}
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackTranslucent;
CGRect frame = theWebView.frame;
NSLog(@"The WebView: %f %f %f %f", frame.origin.x, frame.origin.y, frame.size.width, frame.size.height);
frame = theWebView.superview.frame;
NSLog(@"The WebView superview: %f %f %f %f", frame.origin.x, frame.origin.y, frame.size.width, frame.size.height);
frame.size.height += frame.origin.y;
frame.origin.y = 0;
[theWebView.superview setFrame:frame];
return [ super webViewDidFinishLoad:theWebView ];
}
Результат регистрации этого кода показывает:
The WebView: 0.000000 0.000000 320.000000 460.000000
The WebView superview: 0.000000 20.000000 320.000000 460.000000
, поэтому, исправив кадр webview.superview, вы можете получить эффект UIStatusBarTranslucent
CGRect frame = theWebView.superview.frame;
frame.size.height += frame.origin.y;
frame.origin.y = 0;
[theWebView.superview setFrame:frame];