BlackBerry Web 应用程序 - 100% 宽度未填满屏幕

发布于 2024-09-25 14:50:09 字数 548 浏览 7 评论 0原文

我正在开发一个移动网络应用程序,我注意到我的两部测试手机(BlackBerry 9700 Bold(操作系统 5.0)和 BlackBerry Tour 9630(操作系统 4.7))无法正确渲染宽度。

我有一个简单的表格,我已声明其宽度为 100%,但该表格不会扩展并占据 100% 的屏幕。屏幕右侧有一个 10 像素左右的装订线/白色边框。如果我将宽度硬编码为 480px,那么它会占据整个屏幕,但我不想硬编码宽度值,因为它们可能会有所不同,具体取决于用户使用的 BlackBerry。

我正在使用此元标记: 并尝试设置视口元标记,但收效甚微。

有什么想法吗?我意识到我可以使用 JavaScript 动态设置宽度,但我宁愿不这样做。另外,如果我将渲染的页面保存为 HTML,然后将该 HTML 上传到服务器,那么当我从 BlackBerry 浏览到该页面时,宽度为 100%!考虑到这是相同的代码,这很奇怪。当页面是动态创建的并且宽度变得混乱时,可能会出现问题。

还有其他人经历过类似的事情吗?

I'm working on a mobile web app and I've noticed on both my test phones, which are BlackBerry 9700 Bold (OS 5.0) and BlackBerry Tour 9630 (OS 4.7) do not render width properly.

I have a simple table that I've declared to be width 100%, but the table doesn't expand and take up 100% of the screen. There is a gutter / white border of 10px or so to the right of the screen. If I hard code the width to be 480px, then it takes up the entire screen, but I don't want to hard code width values since they may be different depending on what BlackBerry the user is using.

I'm using this meta tag: <meta name="HandheldFriendly" content="true" /> and experimented with setting the viewport meta tag with little success.

Any ideas? I realize I could set the width dynamically using JavaScript, but I'd rather not. Also, if I save the rendered page as HTML and then upload that HTML to the server, then when I browse to that page from the BlackBerry the width is 100%! This is weird considering it's the same code. Perhaps something is wrong when the page is dynamically created and the width gets messed up.

Anyone else experience something like this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

明媚殇 2024-10-02 14:50:10

我通过这样的视口元解决了这个问题:

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0;" /> 

之后一个简单的“body{width:100%}”就可以正常工作了!

并且它与其他手机兼容。

I solved this problem thanks to the viewport meta like that :

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0;" /> 

After that a simple "body{width:100%}" works fine !

And it's compatible with other phones.

℉絮湮 2024-10-02 14:50:09

我通过在 CSS 中添加以下内容来摆脱装订线空间:

body
{
    margin: 0px;
}

I managed to get rid of the gutter space by adding this in my CSS:

body
{
    margin: 0px;
}
不气馁 2024-10-02 14:50:09

实际上我刚刚为我的项目解决了这个问题。我向未填充整个 BlackBerry 宽度的 div 添加了 min-width:470px,并修复了该问题。

I actually just solved this for my project. I added a min-width:470px to the divs that were not filling the full BlackBerry width, and it fixed it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文