harinder Active Member Licensed User Longtime User Jan 26, 2020 #1 B4X: Sub ScrollView1_ScrollChanged(Position As Int) If scrollview1.FullScroll(True) Then btnAddNew.mBase.visible=True End If End Sub OR B4X: Sub ScrollView1_ScrollChanged(Position As Int) If position = scrollview1.FullScroll(True) Then btnAddNew.mBase.visible=True End If End Sub are not working. I am getting a "Cannot assign void value"
B4X: Sub ScrollView1_ScrollChanged(Position As Int) If scrollview1.FullScroll(True) Then btnAddNew.mBase.visible=True End If End Sub OR B4X: Sub ScrollView1_ScrollChanged(Position As Int) If position = scrollview1.FullScroll(True) Then btnAddNew.mBase.visible=True End If End Sub are not working. I am getting a "Cannot assign void value"
LucaMs Expert Licensed User Longtime User Jan 26, 2020 #2 This is not a function, it is a method, to scroll the internal panel to the Top (you must pass False) or to the Bottom (pass True) harinder said: scrollview1.FullScroll(True) Click to expand... To check if the bottom is reached: B4X: Sub ScrollView1_ScrollChanged(Position As Int) If Position = scrollview1.Height Then log("Bottom reached") btnAddNew.mBase.visible=True End If End Sub Upvote 0
This is not a function, it is a method, to scroll the internal panel to the Top (you must pass False) or to the Bottom (pass True) harinder said: scrollview1.FullScroll(True) Click to expand... To check if the bottom is reached: B4X: Sub ScrollView1_ScrollChanged(Position As Int) If Position = scrollview1.Height Then log("Bottom reached") btnAddNew.mBase.visible=True End If End Sub
harinder Active Member Licensed User Longtime User Jan 26, 2020 #3 Not working...the button doesent get visual Last edited: Jan 26, 2020 Upvote 0
B Brian Dean Well-Known Member Licensed User Longtime User Jan 26, 2020 #4 I think that ScrollView.Position returns the position at the top of the view (for a vertical scroll) so you will need to subtract the height of the view. If your scroll data is 1000 units long and the view is 200 units high then the scroll position will not exceed 800. I would subtract a couple of extra dips just to make sure, and Log the value returned by ScrollView.Position so that you can understand the values that you are working with. Upvote 0
I think that ScrollView.Position returns the position at the top of the view (for a vertical scroll) so you will need to subtract the height of the view. If your scroll data is 1000 units long and the view is 200 units high then the scroll position will not exceed 800. I would subtract a couple of extra dips just to make sure, and Log the value returned by ScrollView.Position so that you can understand the values that you are working with.
Erel B4X founder Staff member Licensed User Longtime User Jan 26, 2020 #5 Why aren't you using xCLV? There is a ReachEnd event. Upvote 0
LucaMs Expert Licensed User Longtime User Jan 26, 2020 #6 SVTest Attachments SVTest.zip SVTest.zip 9.4 KB · Views: 486 Upvote 0
harinder Active Member Licensed User Longtime User Jan 28, 2020 #7 LucaMs said: SVTest Click to expand... Solution very nicely depicted in your example LucaMs..Thank you Erel said: Why aren't you using xCLV? There is a ReachEnd event. Click to expand... Thanks for the tip Erel.. Upvote 0
LucaMs said: SVTest Click to expand... Solution very nicely depicted in your example LucaMs..Thank you Erel said: Why aren't you using xCLV? There is a ReachEnd event. Click to expand... Thanks for the tip Erel..