问题描述
您好我想显示BrowserField HTML内容。我用code blove要做到这一点,但我只看到白色的空白页。
Hi i want to show html content in BrowserField. I used the code blove to do this but i only see white empty page.
BrowserField demo = new BrowserField();
String res="<html><body><p>demo</p></body></html>";
demo.displayContent(res, "http://localhost");
有时,它正确地显示我的网页使用CSS字体,但有时不显示任何东西。
Sometimes it shows my page correctly with css fonts but sometimes it does not show anything.
问题是什么在我的code?
What is the problem in my code?
推荐答案
如果你看看在这个例子黑莓,
他们确保添加()
的 BrowserField
其父管理
之前调用 displayContent()
。
they make sure to add()
the BrowserField
to its parent Manager
before calling displayContent()
.
我不知道,如果你只是忽略该行code,缩短你的问题,如果你错过调用添加()
完全,或者,如果你把它的在调用 displayContent()
。但是,尝试在BlackBerry例子列出的顺序做,让我知道是否可行。
I don't know if you just omitted that line of code to shorten your question, if you're missing the call to add()
entirely, or if you put it after the call to displayContent()
. But, try doing it in the order listed in the BlackBerry example, and let me know if that works.
BrowserField demo = new BrowserField();
add(demo);
String res="<html><body><p>demo</p></body></html>";
demo.displayContent(res, "http://localhost");
这篇关于黑莓BrowserField白色空白页的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!