iOS Question Multiple B4XDialog?

NickCieri

Member
Licensed User
Hello, when I load a B4XDialog dialog1, everything works fine, it looks good in size and everything.

If I open the B4XDialog dialog2, it looks fine and everything is fine.

If I open dialog1 again, it opens in a different size, very small, as if it changed 100%x, I have tried everything, and I can't get them to work well.

They are CustomDialogs, for example...


private Sub GoDataSheet(mp As Map)
'Dim ID As Int= mp.Get("ID")
Dim Name As String = mp.Get("Name")
Try
MediaPlayer.Play
Dim p As B4XView = xui.CreatePanel("")
p.LoadLayout("Datasheet")
p.SetLayoutAnimated(0, 0, 0, 100%x, 600dip)
......
setDialogStyle(DataSheetDialog)
.......
DataSheetDialog.ShowCustom(p, "", "", "")
DataSheetDialog.Base.Top=100
Catch
Log(LastException)
End Try
End Sub
 

NickCieri

Member
Licensed User
I already solved it, 100%x, it is not reliable, it changes constantly.

When creating the page I am saving the original 100%x and then using it wherever I want. This solved my problem.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Please use [code]code here...[/code] tags when posting code.

When creating the page I am saving the original 100%x
That's the wrong solution.
You should only use %x / %y inside the Resize event (or designer script).

You can use Root.Width / Height assuming that the resize event already fired.
 
Upvote 0
Top