ScrollView

roarnold

Active Member
Licensed User
Longtime User
Hey Steve or Erel,

I have tried to set the ScrollView.Height = 650 but it doesn't appear to do so. If you notice I set it to 800 and got the same view from the IDE.

Am I missing something? Also, do I need a tag in the designer so that scroll will work?

Thanks,
R
 

Attachments

  • OBR ScrollView Issue.zip
    63.6 KB · Views: 186

grant1842

Active Member
Licensed User
Longtime User
You should take a look at Erel's custom list view class that uses a scroll view.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
There are two height parameters relevant to a scrollview, the height in the layout defined by Scrollview1.height, and the inner panel height defined by Scrollview1.panel.height (and also both are in the designer).

You have the inner height set to 500 in the designer (inner height), so for the Scrollview to scroll, the scrollview's height on the layout would need to be smaller than 500, otherwise it is all visible anyway.
 
Upvote 0

roarnold

Active Member
Licensed User
Longtime User
Gents,

Loaded Erel's CLV and received the following error:

Parsing code. 0.02
Compiling code. Error
Error compiling program.
Error description: Unknown member: addview
Occurred on line: 58
Panel1.AddView(Panel1.AsView, 0, 0, Panel1.Width, Panel1.Height)
Word: addview


B4X:
Sub Globals
Panel1 As CustomListView

End Sub

Activity_Create(FirstTime As Boolean)

Panel1.Initialize(Me, "Pnl")
Panel1.AddView(Panel1.AsView, 0, 0, Panel1.Width, Panel1.Height)

End Sub



Thx R
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
I think it should be

B4X:
Sub Globals
Panel1 As CustomListView

End Sub

Activity_Create(FirstTime As Boolean)

Panel1.Initialize(Me, "Pnl")   'the event name is "Pnl"
Panel1.AddView(Pnl.AsView, 0, 0, Panel1.Width, Panel1.Height)  'so the view should be llike this

End Sub
 
Upvote 0

roarnold

Active Member
Licensed User
Longtime User
Hi,

I am still getting the "AddView" error regardless of what I use. "Pnl", Panel, or Panel1, so long as they match.

Thanks,
R
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
You have declared Panel1 as a CustomListView and are using it as such, but you are also trying to call a Panel method (addview) which doesn't exist on CutomListView.

Check your code against Erel's original, you need a CustomListView and a Panel.
 
Upvote 0

roarnold

Active Member
Licensed User
Longtime User
Steve,

I have the CustomView installed. I think I see my mistake, above, where :

Panel1.Initialize(Me, "Pnl") should actually be Pnl.Initialize(Me, "Pnl").


Now if I can get it all to work.

Appreciate the help,
Thanks,
R
 
Upvote 0
Top