[英]How to view PDFs in Android webview through Google Docs in an Appgyver Steroids App?
[英]How to create a customized webview in Appgyver Steroids
我打算创建以下设计:
我现在具有以下应用程序结构:
主视图:
<div class="padding" ng-controller="IndexController">
<super-navbar>
<super-navbar-title>
My first app!
</super-navbar-title>
</super-navbar>
</div>
控制器:
angular
.module('example')
.controller('IndexController', function($scope, $document, supersonic) {
$scope.navbarTitle = "Index";
addEventListener('load', load, false);
steroids.view.displayLoading();
var googleLayer = null;
googleLayer = new steroids.views.WebView({ location: "http://example.com/page1" });;
googleLayer.preload({}, {
onSuccess: replaceLayer
});
function load() {
var options = {
side: "left",
width: 150
}
supersonic.ui.views.find("leftDrawer").then(function (leftDrawer) {
supersonic.ui.drawers.init(leftDrawer);
supersonic.ui.drawers.open("leftDrawer")
});
}
function replaceLayer() {
steroids.layers.replace({
view: googleLayer,
}, {
onSuccess: function () {
//alert("The layer stack has been replaced.");
},
onFailure: function (error) {
//alert("Could not replace the layer stack: " + error.errorDescription);
}
});
}
});
结构咖啡:
# Read more about app structure at http://docs.appgyver.com
module.exports =
# See styling options for tabs and other native components in app/common/native-styles/ios.css or app/common/native-styles/android.css
#tabs
rootView:
location: "example#getting-started"
preloads: [
{
id: "learn-more"
location: "example#learn-more"
}
{
id: "using-the-scanner"
location: "example#using-the-scanner"
}
]
drawers:
left:
id: "leftDrawer"
location: "example#drawer"
showOnAppLoad: true
options:
animation: "swingingDoor"
# initialView:
# id: "initialView"
# location: "example#initial-view"
到目前为止的行为:
steroids.view.displayLoading();
) 我认为,应该进行以下修改:
我应该进行哪些修改才能实现所需的行为? 我找不到任何适当的教程或足够的文档。
您的初始视图已被评论。 去除 ”#”
关于您要午餐的第一个视图:
您必须使用Tabs
或InitialView
并且选项卡的工作方式是使用第一个选项卡内容作为预先选择的内容并显示它。 因此,如果您对其进行评论或使其保持打开状态,InitialView将毫无意义。
在Structure.coffee
tabs: [
{
title: "Index"
id: "index"
location: "home#index" # Supersonic module#view type navigation
}
{
title: "About"
id: "geolocation"
location: "home#drawer"
}
{
title: "Internet"
id: "internet"
location: "http://google.com" # URLs are supported!
}
]
对于仅使用InitialView的情况,请注释上面的行,并取消注释下面的行,这是:
rootView:
location: "example#getting-started"
关于抽屉,首先,请确保要使用此数组,以便将其作为module.exports =
一部分。
对于可点击的汉堡包,您现在无法在导航栏中将其显示为图标(我想这个限制是因为将超音速指令呈现为本机UI)。
要解决此问题 ,您可以完全替换它(我不建议这样做,可能会影响应用程序的性能)。
或者只是将此代码添加到要显示它的<super-navbar>
内部内容中(在您的情况下为getting-started.html
<super-navbar-button onclick="supersonic.ui.drawers.open('left')" >
≡
</super-navbar-button>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.