简体   繁体   English

应用程序在浏览器中工作正常,电话上的黑屏

[英]Application working fine in the browser, blank screen on the phone

I am creating an app using the Ionic Framework , Phonegap and AngularJS . 我正在使用Ionic FrameworkPhonegapAngularJS创建一个应用程序。

I have a directive, Item . 我有一个指令Item This directive works just fine when running the application in the browser. 在浏览器中运行应用程序时,此指令可以正常工作。 However, when running the application compiled on my iPhone 5C with iOS7, the directive is not showing up. 但是,在运行带有iOS7的iPhone 5C上编译的应用程序时,该指令未显示。

If I copy the HTML template of the directive and drops it onto the page, it works just fine. 如果我复制指令的HTML模板并将其放到页面上,它就可以正常工作。

Here is the directive: 这是指令:

ItemModule.directive('item', ['$rootScope', function ($rootScope) {
    return {
        restrict: 'E',
        scope: {
            item: '=',
        },

        transclude: true,

        templateUrl: 'js/modules/items/directives/templates/item.html',

        link: function (scope, iElement, iAttrs) {
        }
    };
}])

What am I doing wrong? 我究竟做错了什么?

you say the ajax call is coming successfully, but is it executing correctly? 您说ajax调用成功进行,但是执行正确吗?

try right before your directive: 请在您的指令前尝试:

.config(function($stateProvider, $urlRouterProvider, $sceDelegateProvider) {

    $sceDelegateProvider.resourceUrlWhitelist([
        // Allow same origin resource loads.
        'self',
        // Allow loading from our other assets domain.  Notice there is a difference between * and **.
        'http://km.support.apple.com/**',
    ]);
})

This looks resolution problem. 这看起来是分辨率问题。 Please check the resolution as per phone device. 请根据电话设备检查分辨率。

There is fixed height/width control on the page which is not allowing to render page on Phone and showing blank screen. 页面上有固定的高度/宽度控件,不允许在手机上呈现页面并显示空白屏幕。

To make your web application responsive, you can use bootstrap as well!!! 为了使您的Web应用程序具有响应能力,您还可以使用引导程序!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 应用程序可在浏览器上运行,但不能在Android Phone中运行-App - Application Working on Browser but not in Android Phone - App React Native在手机上显示黑屏 - React Native shows blank screen on phone Facebook上的空白屏幕登录边缘浏览器 - Blank screen on Facebook login on Edge browser React.js在Android浏览器上显示黑屏 - Reactjs displaying blank screen on android browser 地理位置可在网络浏览器上使用,但不能在android手机浏览器上使用 - geolocation working on web browser but not on android phone browser FB API调用可以在浏览器上正常运行,但不能在GAS中运行 - FB API call working fine on browser but not in GAS 输入字段可以在小提琴中正常工作,但不能在浏览器中工作 - input field working fine in fiddle but not in browser 浏览器可以在用户的​​手机上启动应用程序吗? - Can the browser start an application on the user's 'phone? Google GSI 客户端无法使用空白屏幕 - Google GSI client not working with a blank screen PhantomJS在js错误时停止屏幕捕获,但是页面在浏览器中呈现良好 - PhantomJS stops screen capture on js error, but page renders fine in browser
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM