Android Question B4XDialog resize issue

Drago Bratko

Active Member
Licensed User
Longtime User
With this code :
B4X:
    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:
Dialog.Resize(100%x, 100%y)
and
B4X:
options.Resize(Dialog.Base.Width, Dialog.Base.Height)
(and probably some more), but non of them, did the work.

Any ideas ?
 

Drago Bratko

Active Member
Licensed User
Longtime User
Did you try something like this:
B4X:
options.CustomListView1.AsView.width=500dip              
options.CustomListView1.AsView.Height=600dip

Thanks for suggestion.
Just try it … but no change. Of course I have tried to change values … but no change.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Just try it … but no change
If options is a B4XListTemplate, the code below worked for me:
B4X:
options.Initialize
    options.Options = Array("Cat", "Dog", "Fish", "Crocodile",  "Horse", "Elephant", "Mouse")
    options.Resize(450dip, 500dip)
I use XUI Views lib version: 2.30
 
Last edited:
Upvote 0

Drago Bratko

Active Member
Licensed User
Longtime User
Thank you for your help. :)
I use also XUI Views lib version: 2.30

This combination worked fine for me (for the record) :
B4X:
    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
Top