在nativescript ios中的splashscreen之后显示的白色屏幕

时间:2017-09-18 12:58:31

标签: ios angular nativescript

在nativescript ios中,在启动画面后显示白屏几秒钟。它只发生在我们的项目中,但样本项目工作正常。我检查了模拟器和iPhone 5,iPhone 6,iPad mini,所有设备都显示白屏。我在Angular 4中使用Nativescript,这里我包含了我的package.json

{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "com.preludesys.calladoc",
    "tns-ios": {
      "version": "3.1.0"
    }
  },
  "scripts": {
    "tslint": "tslint -p tsconfig.json",
    "ns-bundle": "ns-bundle",
    "publish-ios-bundle": "npm run ns-bundle --ios --publish-app",
    "generate-android-snapshot": "generate-android-snapshot --targetArchs arm,arm64,ia32 --install",
    "start-android-bundle": "npm run ns-bundle --android --run-app",
    "start-ios-bundle": "npm run ns-bundle --ios --run-app",
    "build-android-bundle": "npm run ns-bundle --android --build-app",
    "build-ios-bundle": "npm run ns-bundle --ios --build-app"
  },
  "dependencies": {
    "@angular/animations": "~4.1.0",
    "@angular/common": "~4.1.0",
    "@angular/compiler": "~4.1.0",
    "@angular/core": "~4.1.0",
    "@angular/forms": "~4.1.0",
    "@angular/http": "~4.1.0",
    "@angular/platform-browser": "~4.1.0",
    "@angular/router": "~4.1.0",
    "nativescript": "^3.2.0",
    "nativescript-angular": "~3.0.0",
    "nativescript-camera": "^3.0.1",
    "nativescript-drop-down": "^3.1.0",
    "nativescript-google-maps-sdk": "^2.3.2",
    "nativescript-imagepicker": "^3.0.6",
    "nativescript-iqkeyboardmanager": "^1.1.0",
    "nativescript-loading-indicator": "^2.3.2",
    "nativescript-phone": "^1.3.1",
    "nativescript-ripple": "^2.0.0",
    "nativescript-telerik-ui": "^3.0.4",
    "nativescript-theme-core": "~1.0.2",
    "nativescript-unit-test-runner": "^0.3.4",
    "nativescript-xml2js": "^0.5.2",
    "reflect-metadata": "~0.1.8",
    "rxjs": "~5.3.0",
    "tns-core-modules": "^3.1.1",
    "zone.js": "~0.8.2"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~4.1.0",
    "@ngtools/webpack": "^1.3.0",
    "babel-traverse": "6.24.1",
    "babel-types": "6.24.1",
    "babylon": "6.17.1",
    "codelyzer": "^3.0.1",
    "copy-webpack-plugin": "~4.0.1",
    "extract-text-webpack-plugin": "~2.1.0",
    "filewalker": "^0.1.3",
    "jasmine-core": "^2.6.2",
    "karma": "^1.7.0",
    "karma-jasmine": "^1.0.2",
    "karma-nativescript-launcher": "^0.4.0",
    "lazy": "1.0.11",
    "nativescript-css-loader": "~0.26.0",
    "nativescript-dev-typescript": "~0.4.0",
    "nativescript-dev-webpack": "next",
    "raw-loader": "~0.5.1",
    "resolve-url-loader": "~2.0.2",
    "tslint": "^5.4.2",
    "typescript": "~2.2.1",
    "webpack": "~2.6.1",
    "webpack-bundle-analyzer": "^2.8.2",
    "webpack-sources": "~1.0.1",
    "nativescript-worker-loader": "~0.8.1"
  }
}

我不知道是什么问题,我该如何解决它。所以请j =帮助我。

5 个答案:

答案 0 :(得分:1)

您应该重复引导屏幕的布局或稍微不同的版本(使用微调器和加载...消息)硬编码,一旦应用程序实际加载就会被删除或绘制。这将在引导屏幕和加载的应用程序之间提供平滑且专业的过渡。

答案 1 :(得分:0)

在初始页面加载过程中,iOS上会出现这个简短的“启动后闪屏”。

你无法避免它。但是,您可以使用以下代码更改全局CSS文件中的颜色:

Page {
  background-color: black;
}

答案 2 :(得分:0)

在我们的应用程序中,添加一些“重”插件后,白色屏幕变得更加突出,如nativescript-telerik-ui,nativescript-google-maps-sdk等。

它也发生在旧(慢)Android设备上。

这似乎是不可避免的,真的是一种耻辱。您可以尝试的一件事是使用Webpack,延迟加载等优化加载时间,以便应用加载更快。

建议在启动时以编程方式更改页面背景颜色。

答案 3 :(得分:0)

我正在使用框架,并且找到了使框架背景与启动画面相同的解决方案

Frame {
    background:#4285F4;
}

答案 4 :(得分:0)

要使其也适用于 Android {N}7,请执行以下操作:

frame.ns-root {
    background-color: black;
}