简体   繁体   English

是否可以使用移动Chrome打包应用创建新窗口?

[英]Is it possible to create a new window with mobile Chrome packaged apps?

Can you create multiple windows on the new mobile Chrome packaged apps? 您可以在新的移动Chrome打包应用上创建多个窗口吗? I ask this because 我问这个是因为

chrome.app.window.create("host/index.html", 
{
  id: "host",
  bounds: {
    width: 1000,
    height: 500
  }
});

is working fine on desktop ( 在桌面上工作正常( 截图 ) but not so great on the iOS simulator ( )但在iOS模拟器上却不是那么好( 截图 ). )。

Short answer: Chrome Apps for Mobile do not support multiple windows at the moment. 简短回答:Chrome Apps for Mobile目前不支持多个窗口。

The root of the problem is that mobile devices don't have traditional window managers, per-se. 问题的根源在于移动设备本身没有传统的窗口管理器。

We thought about trying to simulate it with some sort of edge swipe gesture, but it raised a bunch of questions: Should we hijack gestures your application may already be using? 我们考虑尝试用某种边缘滑动手势来模拟它,但它引发了一堆问题:我们应该劫持你的应用程序可能已经在使用的手势吗? Should we have title bars that decrease the size of your application surface? 我们是否应该使用减少应用程序表面大小的标题栏? What if our solution does not fit with the look&feel of your application? 如果我们的解决方案不符合您的应用程序的外观和感觉怎么办? All hard questions to answer, so we opted not to support multiple windows for now. 所有难以回答的问题,所以我们现在选择不支持多个窗口。

On Android L-release, theres a cool new feature that was just announced that will allow applications to have multiple views ("windows") appear in the Recents switcher, so perhaps we can experiment with that.. But I think it would still be more confusing for users to switch between Recents than between windows on desktop chrome, so not sure if will be the right option for most applications. 在Android L-release上,有一个很酷的新功能,刚刚宣布将允许应用程序在Recents切换器中出现多个视图(“窗口”),所以也许我们可以试验一下..但我认为它仍然是用户在“最近”之间切换比在桌面Chrome上的窗口之间切换更令人困惑,因此不确定是否适合大多数应用程序。

If you want to have multiple views within your application, its best to use a web framework that helps for navigating between them within a single window. 如果您希望在应用程序中拥有多个视图,最好使用有助于在单个窗口中导航它们的Web框架。 This has actually generally been the accepted best-practice for hybrid web apps for a long time. 实际上,这通常是混合网络应用程序长期以来最常用的做法。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM