Android Question ScrollView

ivanomonti

Expert
Licensed User
Longtime User
how can I dynamically increase the height of a scrollview panel?


a.JPG


aa.JPG


despite all that you increase the panel height value there is no scroll, the scrollview view is inserted into another scrollview view, but this does not usually create conflicts in my knowledge
 
how can I dynamically increase the height of a scrollview panel?


View attachment 59706

View attachment 59707

despite all that you increase the panel height value there is no scroll, the scrollview view is inserted into another scrollview view, but this does not usually create conflicts in my knowledge
You should not add a scrollview inside another scrollview. It is not an elegant and intuitive UI.
You can change scrollview panel height with
Code: Copy
scv.panel.height = 1000dip
as you wrote
 
Upvote 0
Code: Copy
#Region  Project Attributes 
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName: 
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes 
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Private sv, svp As ScrollView
End Sub

Sub Activity_Create(FirstTime As Boolean)
   
    sv.Initialize(10000dip)
    sv.Color = Colors.Black
    Activity.AddView(sv,0,0,100%x,100%y)
   
    svp.Initialize(10000dip)
    svp.Color =Colors.Red
    sv.Panel.AddView(svp,5%x,25%y,90%x,50%y)

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

the second scrollview does not seem to work!
 
Upvote 0
Code: Copy
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Private sv, svp As ScrollView
End Sub

Sub Activity_Create(FirstTime As Boolean)
 
    sv.Initialize(10000dip)
    sv.Color = Colors.Black
    Activity.AddView(sv,0,0,100%x,100%y)
 
    svp.Initialize(10000dip)
    svp.Color =Colors.Red
    sv.Panel.AddView(svp,5%x,25%y,90%x,50%y)

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

the second scrollview does not seem to work!
As i write, you should not add a scrollview inside another scrollview. This doesn't work
 
Upvote 0
the same with a listview ,,, within a scrollview does not work, my form is a vertical page that scrolls inside with elements of a complex board and rich in other objects such as editext, image and panels

Code: Copy
#Region  Project Attributes 
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName: 
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes 
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Private sv, svp As ScrollView
    Private pn As Panel
    Private lv As ListView
End Sub

Sub Activity_Create(FirstTime As Boolean)
   
    sv.Initialize(10000dip)
    sv.Color = Colors.Black
    Activity.AddView(sv,0,0,100%x,100%y)
   
    pn.Initialize("")
    sv.Panel.AddView(pn,5%x,25%y,90%x,50%y)
   
    lv.Initialize("")
    lv.Color =Colors.Red
    pn.AddView(lv,pn.Left,pn.top,pn.Width,pn.Height)
   
    For i=0 To 100
        lv.AddSingleLine("cazzarola")
    Next

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
 
Upvote 0
Back
Top