Android Question B4XDialog resize issue

Drago Bratko

Active Member
Licensed User
Longtime User
With this code :
B4X: Copy
    Dialog.Title = "Proizvodi"
    Dim rs As Object = Dialog.ShowTemplate(options, "", "", "Odustani")
    Dialog.Base.SetLayoutAnimated(0, Activity.Left + 5%x, Activity.top + 5%y, Activity.Width - 10%x, Activity.Height - 10%y)
    Wait For (rs) Complete (Result As Int)
    If Result = XUI.DialogResponse_Positive Then
        Log(options.SelectedItem)
    End If

I can set size of a dialog at specific size. But loaded template is not resized.

Screenshot_20200501-155224.jpg


I have tried with :
B4X: Copy
Dialog.Resize(100%x, 100%y)
and
B4X: Copy
options.Resize(Dialog.Base.Width, Dialog.Base.Height)
(and probably some more), but non of them, did the work.

Any ideas ?
 
Thank you for your help. :-)
I use also XUI Views lib version: 2.30

This combination worked fine for me (for the record) :
B4X: Copy
    Dim options As B4XListTemplate
    options.Initialize
    For Each p As Proizvod In Starter.Proizvodi
        options.Options.Add(p.Name)
    Next
    options.Resize(90%x, 85%y)
    options.CustomListView1.AsView.width=90%x
    options.CustomListView1.AsView.Height=85%y

    Dim rs As Object = Dialog.ShowTemplate(options, "", "", "Cancel")
    
    Wait For (rs) Complete (Result As Int)
    If Result = XUI.DialogResponse_Positive Then ...
 
Upvote 0
Back
Top