Hello,
I have a problem
I am creating a menu for the settings of my app
I creao a scrollview and a Panel
where I add the various items.
the ScrollView does not scroll
How can I fix the problem?
Use this code
thank you very much
I have a problem
I am creating a menu for the settings of my app
I creao a scrollview and a Panel
where I add the various items.
the ScrollView does not scroll
How can I fix the problem?
Use this code
thank you very much
B4X:
Sub LoadMenu
scvMain.Initialize(0)
Panel1.Initialize("")
Panel1 = scvMain.Panel
Activity.AddView(scvMain, 0, 0, 100%x, 100%y)
scvMain.Panel.Height = Panel1.Height
Dim LblChk As Label
LabelTitle.Initialize("")
' *** TITLE MAIN
LabelTitle.Text = "Title1"
LabelTitle.Gravity = Gravity.CENTER_VERTICAL
LabelTitle.TextSize = 16
scvMain.Panel.AddView(LabelTitle, 8%x, 5dip, LabelTitle.TextSize*Height, Height)
Col.Initialize(Colors.DarkGray, 0)
Line.Initialize("")
Line.Background = Col
scvMain.Panel.AddView(Line, 5%x, 43dip, 90%x, 3dip)
Position = 1
Lbl_1.Gravity = Gravity.CENTER_VERTICAL
Lbl_1.Text = "Name"
scvMain.Panel.AddView(Lbl_1, 10%x, Height * Position, 180dip, Height)
Position = Position + 1
Col.Initialize(Colors.DarkGray, 0)
Line.Initialize("")
Line.Background = Col
scvMain.Panel.AddView(Line, 5%x, Height * Position, 90%x, 1dip)
Lbl_1.Gravity = Gravity.CENTER_VERTICAL
Lbl_1.Text = "EncType"
scvMain.Panel.AddView(Lbl_1, 10%x, Height * Position, 180dip, Height)
Position = Position + 1
Col.Initialize(Colors.DarkGray, 0)
Line.Initialize("")
Line.Background = Col
scvMain.Panel.AddView(Line, 5%x, Height * Position, 90%x, 1dip)
Lbl_2.Gravity = Gravity.CENTER_VERTICAL
Lbl_2.Text = "Password"
scvMain.Panel.AddView(Lbl_2, 10%x, Height * Position, 180dip, Height)
Position = Position + 1
Col.Initialize(Colors.DarkGray, 0)
Line.Initialize("")
Line.Background = Col
scvMain.Panel.AddView(Line, 5%x, Height * Position, 90%x, 1dip)
Lbl_3.Gravity = Gravity.CENTER_VERTICAL
Lbl_3.Text = "Chanl"
scvMain.Panel.AddView(Lbl_3, 10%x, Height * Position, 180dip, Height)
' *** TITLE Device Settings
Position = Position + 1
LabelDeviceSetings.Initialize("")
LabelDeviceSetings.Text = "Device Settings"
LabelDeviceSetings.Gravity = Gravity.CENTER_VERTICAL
LabelDeviceSetings.TextSize = 16
scvMain.Panel.AddView(LabelDeviceSetings, 8%x, Height * Position, LabelDeviceSetings.TextSize*Height, Height)
Col.Initialize(Colors.DarkGray, 0)
Line.Initialize("")
Line.Background = Col
scvMain.Panel.AddView(Line, 5%x, Height * Position, 90%x, 3dip)
Position = Position + 1
Col.Initialize(Colors.DarkGray, 0)
Line.Initialize("")
Line.Background = Col
scvMain.Panel.AddView(Line, 5%x, Height * Position, 90%x, 1dip)
Lbl_Int.Gravity = Gravity.CENTER_VERTICAL
Lbl_Int.Text = "Int"
scvMain.Panel.AddView(Lbl_Int, 10%x, Height * Position, 180dip, Height)
Position = Position + 1
Col.Initialize(Colors.DarkGray, 0)
Line.Initialize("")
Line.Background = Col
scvMain.Panel.AddView(Line, 5%x, Height * Position, 90%x, 1dip)
Lbl_Method.Gravity = Gravity.CENTER_VERTICAL
Lbl_Method.Text = "Method"
scvMain.Panel.AddView(Lbl_Method, 10%x, Height * Position, 180dip, Height)
Position = Position + 1
Col.Initialize(Colors.DarkGray, 0)
Line.Initialize("")
Line.Background = Col
scvMain.Panel.AddView(Line, 5%x, Height * Position, 90%x, 1dip)
LblChk.Initialize("")
LblChk.Text = "Title3"
LblChk.Gravity = Gravity.CENTER_VERTICAL
scvMain.Panel.AddView(Chk_NoFwRel, 80%x, Height * Position, 120dip, Height)
scvMain.Panel.AddView(LblChk, 10%x, Height * Position, 180dip, Height)
Position = Position + 1
Col.Initialize(Colors.DarkGray, 0)
Line.Initialize("")
Line.Background = Col
scvMain.Panel.AddView(Line, 5%x, Height * Position, 90%x, 1dip)
Lbl_Drivers.Gravity = Gravity.CENTER_VERTICAL
Lbl_Drivers.Text = "Drv"
scvMain.Panel.AddView(Lbl_Drivers, 10%x, Height * Position, 180dip, Height)
Position = Position + 1
Col.Initialize(Colors.DarkGray, 0)
Line.Initialize("")
Line.Background = Col
scvMain.Panel.AddView(Line, 5%x, Height * Position, 90%x, 1dip)
Lbl_Mode.Gravity = Gravity.CENTER_VERTICAL
Lbl_Mode.Text = "WiFi Mode"
scvMain.Panel.AddView(Lbl_Mode, 10%x, Height * Position, 180dip, Height)
Position = Position + 1
Col.Initialize(Colors.DarkGray, 0)
Line.Initialize("")
Line.Background = Col
scvMain.Panel.AddView(Line, 5%x, Height * Position, 90%x, 1dip)
Lbl_Type.Gravity = Gravity.CENTER_VERTICAL
Lbl_Type.Text = "Type"
scvMain.Panel.AddView(Lbl_Type, 10%x, Height * Position, 180dip, Height)
' Keep Screen ON
Position = Position + 1
Col.Initialize(Colors.DarkGray, 0)
Line.Initialize("")
Line.Background = Col
scvMain.Panel.AddView(Line, 5%x, Height * Position, 90%x, 1dip)
LblChk.Initialize("")
LblChk.Text = "Keep ON"
LblChk.Gravity = Gravity.CENTER_VERTICAL
scvMain.Panel.AddView(Chk_KeepON, 80%x, Height * Position, 120dip, Height)
scvMain.Panel.AddView(LblChk, 10%x, Height * Position, 180dip, Height)
Position = Position + 1
Col.Initialize(Colors.DarkGray, 0)
Line.Initialize("")
Line.Background = Col
scvMain.Panel.AddView(Line, 5%x, Height * Position, 90%x, 1dip)
LblChk.Initialize("")
LblChk.Text = "Stand-By"
LblChk.Gravity = Gravity.CENTER_VERTICAL
scvMain.Panel.AddView(Chk_StandBy, 80%x, Height * Position, 120dip, Height)
scvMain.Panel.AddView(LblChk, 10%x, Height * Position, 180dip, Height)
Panel1.Height = 100%y '5 * Height
End Sub