不应用角度材质样式

时间:2015-10-13 12:33:32

标签: android angularjs cordova angular-material

我正在使用Cordova在Android设备上运行Angular Material应用。当我使用桌面浏览器测试应用程序时,将应用所有CSS样式。但是,移动WebView无法将CSS应用于yoursearchview.setSubmitButtonEnabled(false); 标记(AngularJS指令)。

的index.html

md-

JS / test.js

<!DOCTYPE html>
<html ng-app="buttonsDemo1">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com; style-src 'self' 'unsafe-inline'; media-src *"/>
    <title>test</title>

    <link rel="stylesheet" href="./bower_components/angular-material/angular-material.css"/>

    <script type="text/javascript" src="./bower_components/angular/angular.js"></script>
    <script type="text/javascript" src="./bower_components/angular-animate/angular-animate.js"></script>
    <script type="text/javascript" src="./bower_components/angular-aria/angular-aria.js"></script>

    <script type="text/javascript" src="./bower_components/angular-material/angular-material.js"></script>
    <script src="./js/test.js"></script>
  </head>
  <body>
    <md-toolbar>
      <div class="md-toolbar-tools">
        <md-button class="md-icon-button md-default-theme" ng-click="app.toggleSidenav('left')"
          aria-label="menu" hide-gt-md>
          <md-icon md-svg-src="img/ic_menu_white_24px.svg"></md-icon>
        </md-button>
        <h3>ttt</h3>
        <span flex></span>
      </div>
    </md-toolbar>

    <script type="text/javascript" src="cordova.js"></script>
  </body>
</html>

Cordova平台:window.onerror = function(message, url, lineNumber) { console.log("Error: "+message+" in "+url+" at line "+lineNumber); }; window.angular.module('buttonsDemo1', [ 'ngAnimate', 'ngMaterial' ]) .config(function($compileProvider){ $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|chrome-extension):/); });

桌面浏览器

Desktop browser

Android设备

Android device

设备日志

android 4.1.1

请帮我找出样式有什么问题。

1 个答案:

答案 0 :(得分:0)

不支持Android 4.1到4.4。使用crosswalk插件,一切都会正常工作。

https://crosswalk-project.org