Other [B4X] [quiz] - Designer layouts differences

Discussion in 'Android Questions' started by Erel, Jan 22, 2017.

  1. Erel

    Erel Administrator Staff Member Licensed User

    B4A, B4J and B4i use the same visual designer with the same features (anchors, variants and designer script).

    There is one important difference between the way that designer layouts are handled in B4A compared to the way that they are handled in B4J and B4i. What is the difference?
  2. ilan

    ilan Expert Licensed User

    Handle Resize?
    Erel likes this.
  3. Cableguy

    Cableguy Expert Licensed User

    The "scale" factor!
    ilan likes this.
  4. Erel

    Erel Administrator Staff Member Licensed User

    This is the difference that I was referring to.


    In B4A the layout is loaded once when the activity is created. Changes to the activity size (orientation change for example) will cause the activity to be destroyed and recreated.

    This is not the case in B4J and B4i. The form or page are never destroyed by the OS. So the layout file is "reapplied" whenever the container size changes.
    Practically it means that if you want to programmatically modify the layout then you need to do it in the resize event or the changes will be lost.
    Last edited: Jan 23, 2017
    ilan likes this.
  5. ilan

    ilan Expert Licensed User

    this is why you should never load a layout in page1_resize event.
    it will be loaded every time the resize event will be called like (orientation change) and you will have multiple views on your page.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice