Blackberry: how to change size of font at browser field on OS 5.0? -
on others versions of platform use this:
browserfieldconfig cfg = new browserfieldconfig(); cfg.setproperty(browserfieldconfig.navigation_mode, browserfieldconfig.navigation_mode_pointer); cfg.setproperty(browserfieldconfig.javascript_enabled, boolean.true); cfg.setproperty(browserfieldconfig.connection_manager, _browseradapter); cfg.setproperty(browserfieldconfig.cookie_manager ,_browseradapter); browserfield = new browserfield(cfg); browserfield.getrenderingoptions().setproperty(renderingoptions.core_options_guid, renderingoptions.minimum_font_size, fontsize);
, , works fine. doesn't work on 5.0 only.
can problem or suggest method change size of font? appreciated.
you may consider inject css rules in browserfield as:
string style = ""; // here css rules string textbody = ""; // here displaying text string browsercontent = "<html><style>" + style + "</style>" + textbody + "</html>"; byte[] contentbytes; try { contentbytes = browsercontent.getbytes("utf-8"); browserfield.displaycontent(contentbytes, "text/html; charset=utf-8", ""); } catch (...) { ... }
in manner may change dinamically text size (and other) replacing injected css style.
Comments
Post a Comment