Android Question Increase the Height and Width of PreferenceDialog Options List of Items

Mahares

Expert
Licensed User
Longtime User
In Erel’s example on PreferenceDialog the Options feature displays items in the list (cities list), but the screen shows a small number of items. I tried a few ways to increase the height and width, to no avail
I tried these 2 lines of code with no effect:
B4X:
prefdialog.mBase.Height =500dip  'no effect and no error
prefdialog.CustomListView1.AsView.Height=500dip  'no effect and no error

Thank you
 

Attachments

  • B4xPreferenceDialogOptionsItemsList.png
    B4xPreferenceDialogOptionsItemsList.png
    17.6 KB · Views: 219

Erel

B4X founder
Staff member
Licensed User
Longtime User
This is how it looks here:

1588055304192.png


I wouldn't make it taller however you can do it based on: https://www.b4x.com/android/forum/t...ax-number-of-items-to-show.112181/post-699761

B4X:
Dim st As B4XSearchTemplate = prefdialog.SearchTemplate
st.MaxNumberOfItemsToShow=15
Dim pane As Panel = st.GetPanel(prefdialog.Dialog)                        'Get the main panel
pane.Height=600dip                                                                          'Set Desired Height
Dim lv As B4XView = st.CustomListView1.AsView             'Get the List View
lv.Height=pane.Height                                                                       'Set Same as Parent
Dim sv As B4XView=lv.GetView(0)                                                      'Get the Scroll View
sv.Height=pane.Height
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
you can do it based on
B4X:
Dim pane As Panel = st.GetPanel(prefdialog.Dialog)                        'Get the main panel
pane.Height=600dip                                                                          'Set Desired Height
Dim lv As B4XView = st.CustomListView1.AsView             'Get the List View
lv.Height=pane.Height                                                                       'Set Same as Parent
Dim sv As B4XView=lv.GetView(0)                                                      'Get the Scroll View
sv.Height=pane.Height
Why do I need all the above code when I can accomplish the same using one line shown below since we are dealing with a B4XSearchTemplate which is re-sizable.:
B4X:
st.Resize(400dip,600dip)
 
Upvote 0
Top