【小编推荐】phonegap iOS webview下移

2014-12-31   |   发布者:梁国芳   |   查看:3320次

前端开发
 在开发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.
}