黑莓BrowserField不适合屏幕 [英] Blackberry BrowserField does not fit to screen

查看:243
本文介绍了黑莓BrowserField不适合屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想显示我的黑莓应用程序的内部网站,但browserfield比屏幕高度小,我不能老是让相同的大小。

I'm trying to display a website inside my blackberry app but the browserfield is smaller than the screen height and i can`t make it the same size.

这是beeing加载页面实际上是小然后屏幕,但该网站是专为移动设备和iPhone上的web视图,blabkberry浏览器和Firefox和Chrome非常适合。

The page that is beeing loaded is actually smaller then the screen but the website is designed for mobile devices and fits perfectly on iphone webview, blabkberry browser and firefox and chrome.

我的code是以下内容:

My code is the following:

    manager = new VerticalFieldManager(VerticalFieldManager.VERTICAL_SCROLL | VerticalFieldManager.HORIZONTAL_SCROLL)
    {
        protected void sublayout(int maxWidth, int maxHeight)
        {
            super.sublayout(maxWidth, maxHeight);
            setExtent(Display.getWidth(), Display.getHeight());
        }
    };
    manager.setBackground(BackgroundFactory.createSolidBackground(Color.RED));

    BrowserFieldConfig myBrowserFieldConfig = new BrowserFieldConfig();

    myBrowserFieldConfig.setProperty(BrowserFieldConfig.ALLOW_CS_XHR, Boolean.TRUE);
    myBrowserFieldConfig.setProperty(BrowserFieldConfig.JAVASCRIPT_ENABLED, Boolean.TRUE);
    myBrowserFieldConfig.setProperty(BrowserFieldConfig.INITIAL_SCALE, new Float(1));

    browserField = new BrowserField(myBrowserFieldConfig);
    browserField.requestContent(link);

    manager.add(browserField);

这是我得到的效果是这样的:当我加载该画面的孔筛红(经理背景)。在屏幕变白后(我认为这是browserfield),然后当网页加载屏幕将再次变成红色和白色片缩小到线的高度和成长,如网页ellements开始显现。问题是,页面应该适合因为它在iPhone和自定义浏览器中的所有画面。

The effect that I get is the following: when i load this screen the hole screen is red (the manager background). After that the screen turns white (i think this is the browserfield) and then when the webpage is loaded the screen turns red again and the white piece shrinks to a line height and grows as the webpage ellements starts to show. The problem is that the page should fit all the screen as it does in iphone and custom browsers.

OBS:我使用的是黑莓OS版本6

OBS: I'm using blackberry OS version 6

推荐答案

我不知道如果我的解决方案将帮助你,但我面对完全一样的问题,因为你的,通过增加开支就是几个小时,我终于修好了之后在我的HTML页面的标题部分以下行:

I don't know if my solution would help you but I faced exactly the same issue as yours,after spending hours on it I finally fixed it by adding the following line in the header section of my html page:

<meta name="viewport" content="width=device-width,height=device-height,minimum-scale=1, maximum-scale=1" />

高度=设备的高度固定我的问题。

Height=device-height fixed my issue

这篇关于黑莓BrowserField不适合屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆