zoukankan      html  css  js  c++  java
  • Ionic 的常见问题

    1. 启动页(手动关闭)

    <preference name="SplashScreen" value="screen"/>
    <preference name="SplashScreenDelay" value="10000"/>
    <preference name="AutoHideSplashScreen" value="false" />
    <preference name="ShowSplashScreenSpinner" value="false" />
    <preference name="FadeSplashScreen" value="true" />
    <preference name="FadeSplashScreenDuration" value="1.0" />


    app.run(function ($ionicPlatform) {
    $ionicPlatform.ready(function () {
    setTimeout(function () {
    navigator.splashscreen.hide();
    }, 100);
    });
    // your config
    ...
    })

    2. Image picker插件报错的问题

    IOS ELCImagePicker Implicit conversion from enumeration type ALAssetOrientation to different enumeration type UIImageOrientation

    Implicit conversion from enumeration type 'ALAssetOrientation' (aka 'enum ALAssetOrientation) to different enumeration type 'UIImageOrientation' (aka 'UIImageOrientation')

    之前的代码

    if (_returnsOriginalImage) {
        imgRef = [assetRep fullResolutionImage];
        orientation = [assetRep orientation];
    } else {
        imgRef = [assetRep fullScreenImage];
    }

    改为

    if (_returnsOriginalImage) {
        imgRef = [assetRep fullResolutionImage];
    
        NSNumber *orientationValue = [asset valueForProperty:@"ALAssetPropertyOrientation"];
        if (orientationValue != nil) {
            orientation = [orientationValue intValue];
        }
    
    } else {
        imgRef = [assetRep fullScreenImage];
    }

     IOS https无法请求的问题

    修改AppDelegate.m

    @implementation NSURLRequest(DataController)
    + (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host
    {
        return YES;
    }
    @end

     $ionicHistory.removeBackView();bug

     修复代码如下

    IOS 插件中文显示:

    修改 *-.plist 文件

    <key>CFBundleDevelopmentRegion</key>
    <string>zh_CN</string>

    IOS相册和相机打开挂掉:

    缺少描述   在*-.plist上增加如下代码

    <key>NSPhotoLibraryUsageDescription</key>
    <string>请选择一张照片</string>
    <key>NSPhotoLibraryAddUsageDescription</key>
    <string>请选择一张照片</string>
    <key>NSCameraUsageDescription</key>
    <string>请拍摄</string>

    NavBar显示与隐藏的需求

    有的时候我们需要一个页面的navbar不要显示,但是直接使用hide-nav-bar来控制的话,页面的动画就特别不协调,因为控制navbar的显示与隐藏是通过display:none来处理的,这种方式会导致页面元素的占位体积为0。要是能通过opacity:0是不是就可以完美解决这个问题。

    下面就是方法

    ok 对ionic.bundle.js就改完了,如下直接使用就行了。

  • 相关阅读:
    linux内核(四)内存管理单元MMU
    open函数详解
    linux内核(三)文件系统
    C++中数字与字符串之间的转换 scanf string总结(复习必读)
    hello程序的运行过程-从计算机系统角度
    剑指offer第12题打印从1到n位数以及大整数加法乘法
    2017-10-11第二次万革始面经
    为什么需要半关闭
    Ubuntu指令
    143. Reorder List
  • 原文地址:https://www.cnblogs.com/Purk/p/7998397.html
Copyright © 2011-2022 走看看