我正在写一个Phonegap 3.0+应用程序.
在iOS7中状态栏重叠视图存在问题,用户Ludwig Kristoffersson在此提供了一个有效的答案
现在我的UIWebView具有20px的上边距,如何更改UIWebView背景颜色?我需要状态栏后面的区域与"人物"工具栏的背景颜色相同.

我几乎没有Objective C的经验,并且一直在寻找可能的SO问题来找到一个有效的解决方案,但没有成功.
UIWebView背景颜色
UIWebView背景设置为Clear Color,但它不透明
下面是我到目前为止尝试过的代码:
- (void)viewWillAppear:(BOOL)animated {
//Lower screen 20px on ios 7
if([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
CGRect viewBounds = [self.webView bounds];
viewBounds.origin.y = 20;
viewBounds.size.height = viewBounds.size.height - 20;
self.webView.frame = viewBounds;
[self.webView setOpaque:YES];
//neither of these seem to work when uncommented:
// [self.webView setBackgroundColor:[UIColor grayColor]];
// self.webView.backgroundColor=[UIColor grayColor];
}
[super viewWillAppear:animated];
}
Run Code Online (Sandbox Code Playgroud)
更新1
- (void)viewWillAppear:(BOOL)animated
{
//Lower screen 20px on ios 7
if ([[[UIDevice currentDevice] systemVersion] floatValue] …Run Code Online (Sandbox Code Playgroud) 检查JavaScript中的变量是否未定义时的常见做法如下:
var isUndefined=(typeof variableName==="undefined");
Run Code Online (Sandbox Code Playgroud)
我最近遇到使用两个感叹号来确定相同的逻辑:
var isUndefined=!!variableName;
Run Code Online (Sandbox Code Playgroud)
是否可以使用PhoneGap(v1.4.1)在iPhone设置应用中创建一个部分?
我在PhoneGap API中找不到任何相关内容.
我的目标是在JavaScript中使用用户设置值.
我想如果PhoneGap目前没有此功能,可以使用PhoneGap插件执行此任务.
有没有人知道当前的插件可能会启用Settings.bundle创建和阅读?
javascript objective-c settings.bundle phonegap-plugins cordova
cordova ×2
javascript ×2
objective-c ×2
boolean ×1
ios ×1
ios7 ×1
typeof ×1
uiwebview ×1
undefined ×1