Yuriy
Yuriy

Reputation: 51

change font size in browser field blackberry

here is the code:


public class MyHttp extends MainScreen{
   public static final String HTTP_FILE = "local:///sources";
   public MyHttp(String fileName){
       BrowserField browserField = new BrowserField();
       add(browserField);
       try{ 
           browserField.requestContent(HTTP_FILE + fileName);
       } catch (Exception ex) {
           ex.printStackTrace();
       }
   }
}

how can I change the font size in this browserField?
Any ideas? Thanks in advance.

Upvotes: 1

Views: 1295

Answers (2)

Glen Morgan
Glen Morgan

Reputation: 41

As the BrowserField is an extension of type Field, it inherits the setFont method:

browserField.setFont(myFont);

I don't have 5.0 running on my local box so I couldn't test it but according to the API it should work.

Hope this helps

Upvotes: 0

Nick Hudson
Nick Hudson

Reputation: 11

If you have the file locally, you can add CSS styles to set the font size accordingly.

If you are using the 6.0 SDK, you MUST set the viewport tag or the font size will be ignored:

<head>
   <meta name='viewport' content='width=device-width,height=device-height,initial-scale=1.0'>
   <style> (Your CSS styles) </style>
</head>

Upvotes: 1

Related Questions