iOS Question layout issues

jamesnz

Active Member
Licensed User
Longtime User
I have 2 questions regarding layout
In android we can alter the height or layer of a visual component, allowing us to place one component on top of another, how do we achieve this in IOS ?

2/I have a panel, hosted on that panel is a thin button, but on the designer it is showing below the panel. On the phne it does not show at all, The buttons parent is the panel so it should work but it does not.(see pic)
 

Attachments

  • layout_issue.PNG
    layout_issue.PNG
    57.8 KB · Views: 225

jamesnz

Active Member
Licensed User
Longtime User
I have fixed the button visability issue by removing the button as a child of the panel and making it a child of the main page, however this means the user can drag the button onto other panels , it needs to be constrained to the desired panel. I can probably get around this programatically but this is the opposite of what I had expected
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
In android we can alter the height or layer of a visual component, allowing us to place one component on top of another, how do we achieve this in IOS ?
The order is defined based on the order of views in the tree. You can change it by dragging the views in the tree.
There is no "elevation" property in iOS.

About the button, it is better if you upload the layout file.
Note that you don't need all this designer script code. Use anchors instead. They are simpler.
 
Upvote 0

jamesnz

Active Member
Licensed User
Longtime User
Thankyou, I have different layouts for portrait and landscape , in portrait I have a map on top and a canvas on the bottom, in landscape they are side by side.
I had trouble with the autoscaling so had to make specific variants, Perhaps my phone reports the screen size incorrectly
There also seem to be issues with the canvas also which reads the width incorrectly in portrait, even though the canvas is added/sized in pg_Resize. I also can't seem to clear it, even when calling c.initialise or c.release.
entire project is zipped here
https://www.dropbox.com/s/9mb4ob338gw9pon/qviz2.zip?dl=0

to get it working you select an item from the listpicker
then a blank page will open
repeat this step till an entry appears
when you click on the entry a map and graph should appear
you will note the graph width is only about 75% of the width of the panel ( i recently set it to 1.3x) still makes no difference
when you go back t select another item you will see the chart is redrawn but the old chart is still present.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I've only checked one layout file, however there were several mistakes in it.

For example you are calling AutoScaleAll twice. Once in the general script and the second time in the variant script.
This is how I would have designed the main layout:

SS-2017-06-21_15.26.53.png


Notice the small dots that show the anchors. The only script needed is for the two buttons. There is only a single variant and there is no variant specific script.
 
Upvote 0

jamesnz

Active Member
Licensed User
Longtime User
The layouts I'm having issues with have side by side panels but it is not the panels that are the issue it's the widths
I can not get the canvas to clear, even when re initialising it, calling c.release and even removing it from the panel , if I come back to the page it redraws the canvas over an old one and wont fill the screen correctly.

Having the same issue with a custom scroll view, anything i add to the scrollview only appears on the 2nd attempt and then only at the left of the screen
chart_firstrun.png
chart_after_returning.png
listpickerview_firstrun.png
listpickerview.png
 
Upvote 0

jamesnz

Active Member
Licensed User
Longtime User
sorry, I just made a new post about canvas. I can delete it
I have tried initialise, release and even romoving the canvas from the panel and re adding it on resize, but the data still persists
 
Upvote 0
Top