在开发app中, 使用phonegap 做的ios 应用, 默认的webview 是在顶部的,但是顶部有电池,信号等导航,所以要下移20px
解决方法:
咋 cordovalib.xcodeproj 下 class---cleaver-----CDVViewController.m中,
下移20px
- (UIWebView*)newCordovaViewWithFrame:(CGRect)bounds
{
return [[UIWebView alloc] initWithFrame:CGRectMake(bounds.origin.x, bounds.origin.y+20, bounds.size.width, bounds.size.height -20)];
}
ps:搜索 (UIWebView*)newCordovaViewWithFrame:(CGRect)bounds 可找到相应的位置。
设置背景;
修改颜色
- (void)viewDidLoad
{
[super viewDidLoad];
self.view.backgroundColor = [UIColor redColor];
// Do any additional setup after loading the view from its nib.
}