Cordova 问题点备忘

本文解决了Cordova5.0中创建本地文件夹路径变更的问题,并提供了解决方案链接。同时,针对iOS7及以上版本的状态栏留白问题,给出了具体的代码修改建议。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1 cordova File插件问题

cordova 5.0创建本地文件夹 目录变成了 file:///data/user/0/com.xxx.xxx/xxx

4.0 是 file:///storage/emulated/0/xxx ,即可以在SD卡下面看到

解决方案:https://www.npmjs.com/package/cordova-plugin-file#upgrading-notes

 

2 ios上方状态栏留白(ios7以上)

修改MainViewController.m的- (void)viewWillAppear:(BOOL)animated 方法:

- (void)viewWillAppear:(BOOL)animated
{
    // View defaults to full size.  If you want to customize the view's size, or its subviews (e.g. webView),
    // you can do so here.
    
    // ios上方状态栏留白 --update by jager 20160630
    // begin
    if(loadView && [[[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;
        loadView = false;
    }
    // end

    [super viewWillAppear:animated];
}

 

转载于:https://www.cnblogs.com/jager/p/5090653.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值