WebOS Mojo HTML5 应用程序和视口
我有一个 HTML 应用程序,我已经在 Android 上发布了。
在 WebOS 上,只需稍作调整,它就可以正常工作。唯一不起作用的是视口的可伸缩性。我有 2 页。一种是可扩展的,另一种则不可扩展。
可扩展的似乎从来都行不通。这就是我的元的样子:
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=1, maximum-scale=2" />
我尝试过其他 WebOS 开发人员推荐的其他元,但我认为我的问题出在其他地方。
这是你说“哦,这就是问题所在!”的部分。我的应用程序没有在 PhoneGap 上运行(没有看到重点,没有使用任何 Mojo 功能)。另外,我没有使用 WebView。我刚刚在 index.html 上添加了我的代码。然后该代码调用另一个 html 文件,一切正常。没有 JS 或功能问题。
这就是为什么我想知道,我真的需要使用 WebView 吗?
第一个场景也加载了一些 html,但这一切都有效。
first-assistant.js 除以下代码外没有其他代码:
this.controller.stageController.setWindowOrientation('left');
On FirstAssistant.prototype.setup。
舞台助理只是推动第一个场景。
提前致谢。
I have an HTML App which I've already released on Android.
On WebOS, with minor tweaks, it's working fine. The only thing which does not work is the scalability of the viewport. I have 2 pages. One is scalable, and the other is not.
The scalable one never seems to work. This is what my meta looks like:
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=1, maximum-scale=2" />
I've tried others recommended by other WebOS developers but I think my problem lies elsewhere.
Here's the part where you say "Oh, that's the problem!". My app is not running on PhoneGap (don't see the point, not using any Mojo features). Also, I'm not using a WebView. I've just added my code on index.html. That code then calls another html file and everything works fine. No JS or functionality issues.
That's why I wonder, do I really need to use a WebView?
There's a first scene which loads a bit of html too, but that all works.
The first-assistant.js has no other code than:
this.controller.stageController.setWindowOrientation('left');
On FirstAssistant.prototype.setup.
Stage Assistant just pushes the first scene.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据你的描述,我认为问题可能是这样的。由于您希望页面可缩放,因此当您缩放页面时,主场景会尝试帮助您并使其自身可滚动。因为听起来这不是您想要的,所以当您从舞台助理推送主场景时,请确保将场景滚动器设置为禁用,如下所示:
但这可能会错过标记,如果是这样,请回复我留下的评论关于你的问题。
Based on what you've stated, I think the issue may be this. Since you want the page to be scalable, when you go to scale it the main scene tries to help you and makes itself scrollable. Since it sounds like that's not what you want, when you push the main scene from your stage assistant make sure you set the scene scroller to disabled like so:
This might miss the mark, though, and if so please respond to the comment I left on your question.
哎呀,我自己刚刚处理完这件事。
不幸的是,Palm Webkit 实现中存在一个错误。尽管在 Palm 的开发人员资源中进行了记录,但不支持“用户可扩展:否”视口元标记属性。
2010 年 5 月 6 日,WebOSKev 表示:
请参阅以下内容了解更多信息:
https://developer.palm.com/distribution /viewtopic.php?f=80&t=6448&start=0
Yuck, just got done dealing with this myself.
Unfortunately, there is a bug in the Palm Webkit implementation. Despite being documented in Palm's developer resources, the "user-scalable: no" viewport meta tag attribute is not supported.
On May 6th, 2010, WebOSKev said:
See the following for more:
https://developer.palm.com/distribution/viewtopic.php?f=80&t=6448&start=0