Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Problem with BorderLayout.SOUTH and Image

  1. #1
    Sencha User
    Join Date
    May 2011
    Posts
    7

    Default Answered: Problem with BorderLayout.SOUTH and Image

    Hello everyone,
    First of all sorry if this is not the right place to put this question.

    I created an application taking the example of BorderLayout. The difference is that I added a background image on top of the web page.

    The problem is that my south panel is not entirely visible and the StatusBar I added to this panel is not visible at all ("Before" screenshot).

    I can solve this problem by resizing the browser size ("After" screenshot).

    Is there any way to fix this problem ? Maybe there is a way to "simulate" the resizing of the browser but I couldn't find it...

    Thanks in advance.
    Attached Images Attached Images

  2. From your code,

    image = new Image("ProgServer.png");
    viewport.add(image, new RowData(1, -1));

    I'm assuming from your discussion with sven that you've tried to set the second parameter to be the height of the image?

    This is likely happening because the image doesnt load right away, so the layout can't tell how much room it should leave.

    Another solution would be to use -1 as the height (meaning measure during layout), and call viewport.layout(true) again after the image has loaded (this is the same code that resizing the browser calls). This can be done through the Image method addLoadHandler.

    Also, please consider making small examples in one class - while this will take more time on your part, it is much easier for us to read, and in changing the setup, you might learn more about what other things affect the issue you are having.

  3. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Answers
    60

    Default

    Would it be possible to post your code in a small, standalone testcase that implements EntryPoint? This way it would be much easier to help you

  4. #3
    Sencha User
    Join Date
    May 2011
    Posts
    7

    Default

    Sorry, I forgot to post my code.
    Attached Files Attached Files

  5. #4
    Sencha User
    Join Date
    May 2011
    Posts
    7

    Default

    Another information : if I remove the top image, it works perfectly but I want to have this image in my application.

  6. #5
    Sencha User
    Join Date
    Mar 2011
    Posts
    79

    Default

    Did you try to specify the border layout panel height explicitly?

  7. #6
    Sencha User
    Join Date
    May 2011
    Posts
    7

    Default

    I tried to do "setHeight(Window.getClientHeight());" after "add(south, southData);" in BorderLayoutExample class but nothing happened...

  8. #7
    Sencha User
    Join Date
    Mar 2011
    Posts
    79

    Default

    Did you try to set heigh which is less than window client height on the height of that background image you used?

  9. #8
    Sencha User
    Join Date
    May 2011
    Posts
    7

    Default

    Yes, I tried. I even tried to do "setHeight(100);" and still nothing happened...

  10. #9
    Sencha User
    Join Date
    May 2011
    Posts
    7

    Default

    Does anyone have a clue for this problem please ?

  11. #10
    Sencha User
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,737
    Answers
    109

    Default

    From your code,

    image = new Image("ProgServer.png");
    viewport.add(image, new RowData(1, -1));

    I'm assuming from your discussion with sven that you've tried to set the second parameter to be the height of the image?

    This is likely happening because the image doesnt load right away, so the layout can't tell how much room it should leave.

    Another solution would be to use -1 as the height (meaning measure during layout), and call viewport.layout(true) again after the image has loaded (this is the same code that resizing the browser calls). This can be done through the Image method addLoadHandler.

    Also, please consider making small examples in one class - while this will take more time on your part, it is much easier for us to read, and in changing the setup, you might learn more about what other things affect the issue you are having.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •