Android Question How to enable Scrollbar in PreferencesDialog? (SOLVED)

skrjabin

Active Member
Licensed User
I tried now different variants, but scrollbar is not visible. How to enable Scrollbar in PreferencesDialog?

B4X:
Sub ManageSettings
    Dim sets As Map = cG.mapSettings
    'Dim pd_Settings As PreferencesDialog 'already in Globals
    'pd_Settings.Initialize(Activity, "Settings", 300dip, 200dip) 'already in Activity_Create
    pd_Settings.LoadFromJson(File.ReadString(File.DirAssets, "Settings.json"))
    Wait For (pd_Settings.ShowDialog(sets, "OK", "CANCEL")) Complete (Result As Int)
    If Result = xui.DialogResponse_Positive Then
        File.WriteMap(xui.DefaultFolder, cG.SETTINGSFILE, sets)
    End If
End Sub

Sub btnSettings_Click
    setVerticalScrollBarEnabled(pd_Settings.CustomListView1.sv, True) 'before loading pref dialog?
    ManageSettings
    setVerticalScrollBarEnabled(pd_Settings.CustomListView1.sv, True) 'after loading pref dialog?
End Sub

'displays or hides the VerticalScrollBar of the ScrollView
Sub setVerticalScrollBarEnabled(v As View, Enabled As Boolean) 'https://www.b4x.com/android/forum/threads/scrollview-properties.40878/
    Dim jo = v As JavaObject
    jo.RunMethod("setVerticalScrollBarEnabled", Array As Object (Enabled))
End Sub
 

skrjabin

Active Member
Licensed User
I created a small project and was confused, because here it worked. Than I tried out step by step, where are the differences between the test and the real project.
The answer:
In Manifest Editor should be::
CreateResourceFromFile(Macro, Themes.LightTheme)
I had in the real project ".DarkTheme" and so with the Preferences JSON-File LightTheme there was no scrollbar.
SOLVED
 
Upvote 0
Top