Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User girish_m.v's Avatar
    Join Date
    May 2010
    Posts
    10
    I am developing a midlet using eswt. It has a image at the top, browser at the middle and the footer image at the bottom

    My code is

    Code:
    demoShell = new Shell(SWT.MAX);
           
            demoShell.setText("Browser");
            demoShell.setLayout(new RowLayout(SWT.HORIZONTAL));
           
    
            demoShell.setSize(240,320);
            demoShell.layout();
    
            closeCommand = new Command(demoShell, Command.EXIT, 0);
            closeCommand.setText("Close");
            closeCommand.addSelectionListener(this);
    
            InputStream is = getClass().getResourceAsStream("/footer.gif");
            angryImage = new Image(demoShell.getDisplay(), is);
            img = new Label(demoShell, SWT.TOP);
            img.setImage(angryImage);
    
            backCommand = new Command(demoShell, Command.BACK, 0);
            backCommand.setText("Back");
            backCommand.addSelectionListener(this);
    
            forwardCommand = new Command(demoShell, Command.OK, 0);
            forwardCommand.setText("Forward");
            forwardCommand.addSelectionListener(this);
    
            goToWebPageCommand = new Command(demoShell, Command.OK, 0);
            goToWebPageCommand.setText("Go To Web Page");
            goToWebPageCommand.addSelectionListener(this);
    
            //create the browser
            browser = new Browser(demoShell, SWT.NONE);
            //browser.setSize(260, 240);
            browser.setBounds(5, 75, 240, 100);
            
            browser.pack(false);
    
            img = new Label(demoShell, SWT.BOTTOM);
            img.setImage(angryImage);
    
            demoShell.open();
            demoShell.setActive();
    
            //browse to nokia.com
            browser.setUrl("http://forumnokia.mobi");
    When I start the application the layout shows correctly with 2 images with the browser. After few seconds the browser stretches itself in such a way, the image below the browser hides itself. Is there any way to stop resizing the browser? or is there any other way to render the browser with the 2 images correctly?

    Thanks in advance,
    Girish

  2. #2
    Nokia Developer Expert gorkem.ercan's Avatar
    Join Date
    Nov 2008
    Posts
    72
    The preferred size of the Browser on S60 is screen size so the next time layout manager (in your case RowLayout) tries to layout it resizes the Browser. You can use the RowData to hint a preferred size for Browser to RowLayout. Or if you want a more scalable solution that does not depend on fixed size values. You can use GridLayout and GridData.

  3. #3
    Registered User girish_m.v's Avatar
    Join Date
    May 2010
    Posts
    10
    Thanks for the reply. I used RowData and the browser fits correctly without stretching itself.

    Thanks again,
    Girish

Similar Threads

  1. UA Profile and Accept headers for S60 3rd Ed. FP 1 Browser
    By Nokia Ron in forum Mobile Web Site Development
    Replies: 5
    Last Post: 2009-10-07, 20:43
  2. HTTP headers for S60 3rd Ed. Browser
    By Nokia Ron in forum Mobile Web Site Development
    Replies: 16
    Last Post: 2009-09-22, 14:28
  3. Custom window in ALL screen modes
    By PawelDefee in forum Symbian C++
    Replies: 11
    Last Post: 2009-02-11, 09:19
  4. Resizing CFbsBitGc?
    By Haktivex in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-04-19, 12:23
  5. UI: Full Screen Mode
    By GENERAL_INFO in forum Symbian User Interface
    Replies: 3
    Last Post: 2004-11-22, 06:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved