iOS Question Resize slow

Discussion in 'iOS Questions' started by fishwolf, Jan 26, 2015.

  1. fishwolf

    fishwolf Active Member Licensed User

    I have 5 buttons with image that i use as graphic menu.

    i use a routine similar to
    http://www.b4x.com/android/forum/threads/resize-all-views-to-any-screen-size.46600/

    i have draw for ipad, when start the page on iphone, i see for a moment the button with big dimension
    and after a moment a see the button with iphone dimension.

    the time for resize is big on iphone in debug and release mode
    the time for resize is medium on ipad2 in debug mode
    the time for resize is small on ipad2 in release mode

    i use the same routine in other pages with label, edit and text button without visible problem

    i call the rountine in resize event.

    Why?
    is it normal that the page draw before the resize event?
    how to fix?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    I highly recommend you to avoid using such code. All the designer features from B4A are now available in B4i: anchors, autoscale all and designer script.

    There is no reason to use such code.
     
  3. fishwolf

    fishwolf Active Member Licensed User

    ok, but i don't understand how to work autoscale.

    i have create a simple design with 2 Layout (320x480 and 240x320)

    when i run on 240x320 device (emulator) the design is broken.
     

    Attached Files:

  4. Erel

    Erel Administrator Staff Member Licensed User

    There is no iOS device with 240x320 screen? How do you run it on an emulator?
     
  5. fishwolf

    fishwolf Active Member Licensed User

    i have done a test with B4A, you say that the designer feature are the same, now i have a only ios device.

    even when I developed for B4A I did not understand with use autoscale
     
  6. klaus

    klaus Expert Licensed User

    Have you read the Beginner's Guide ?
    Chapters:
    5 Screen sizes and resolutions
    8.10 Anchors
    8.11 AutoScale
     
  7. fishwolf

    fishwolf Active Member Licensed User

    Sorry, i have read this chapters and done some test, i have tried to use Autoscale feature without big benefit.

    i have understand that:
    1) You can create a Layout for each devices/resolution that you want manage and draw each interface. It's impossible on android, it's heavy on IOS.
    2) You can create a design script that with percentage value draw a generic interface.
    3) You can create a code script similar to step2

    I don't find a method for create a design for a single device and have a automatic scale for each devices.

    Is it right?
     
  8. klaus

    klaus Expert Licensed User

    Unfortunately, it is not that simple. You cannot have one layout and automatically get a scaling for all screen sizes.
    You can, with one layout (one for each orientaion), AutoScale and DesignerScripts adjust the layout for the different screens.
    Depending on the kind of application, having a same layout for a 3.5'' and a 10'' screen may not be a good solution.
    You could have a look at the AutoScale Code Module.
     
Loading...
  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