S stevenindon Active Member Licensed User Feb 26, 2022 #1 Hello all, I have created 2 pages in B4X (MainPage and a MapPage). In the MainPage, I have a Scrollview loaded with a Designer Page as such : B4X: ScrollView1.ScrollViewInnerPanel.LoadLayout("MainMenu") ScrollView1.ScrollViewContentHeight=PnlMainmenu.Height On application start, I scroll down the scroll view to view contents inside the scrollview... then i jump to second page (MapPage). But when i go back to Mainpage (Where the scroll view is), How can i make the scroll view back to its content top position again? I tried : Private Sub B4xPage_Appear ScrollView1.ScrollViewInnerPanel.Top=0 <------------ but this doesn't seems to work End Sub
Hello all, I have created 2 pages in B4X (MainPage and a MapPage). In the MainPage, I have a Scrollview loaded with a Designer Page as such : B4X: ScrollView1.ScrollViewInnerPanel.LoadLayout("MainMenu") ScrollView1.ScrollViewContentHeight=PnlMainmenu.Height On application start, I scroll down the scroll view to view contents inside the scrollview... then i jump to second page (MapPage). But when i go back to Mainpage (Where the scroll view is), How can i make the scroll view back to its content top position again? I tried : Private Sub B4xPage_Appear ScrollView1.ScrollViewInnerPanel.Top=0 <------------ but this doesn't seems to work End Sub
S stevenindon Active Member Licensed User Feb 26, 2022 #2 Hi All, Got the answer after searching from forum. This is how it is done : B4X: Private Sub B4xPage_Appear ScrollView1.As(ScrollView).ScrollToNow(0) End Sub Upvote 0
Hi All, Got the answer after searching from forum. This is how it is done : B4X: Private Sub B4xPage_Appear ScrollView1.As(ScrollView).ScrollToNow(0) End Sub
klaus Expert Licensed User Longtime User Feb 26, 2022 #3 Or, multi platform: B4X: Private Sub B4xPage_Appear ScrollView1.ScrollViewOffsetY = 0 End Sub Edit: Changed ScrollView1.ScrollViewOffsetY(0), which is wrong, to ScrollView1.ScrollViewOffsetY = 0 Last edited: Feb 26, 2022 Upvote 0
Or, multi platform: B4X: Private Sub B4xPage_Appear ScrollView1.ScrollViewOffsetY = 0 End Sub Edit: Changed ScrollView1.ScrollViewOffsetY(0), which is wrong, to ScrollView1.ScrollViewOffsetY = 0
S stevenindon Active Member Licensed User Feb 26, 2022 #4 Klaus, Thank you for the suggestion. I have tried the code above but it is not working... once i type yr code, It goes red Upvote 0
Klaus, Thank you for the suggestion. I have tried the code above but it is not working... once i type yr code, It goes red
klaus Expert Licensed User Longtime User Feb 26, 2022 #5 Sorry, it should be: B4X: Private Sub B4xPage_Appear ScrollView1.ScrollViewOffsetY = 0 End Sub Upvote 0
S stevenindon Active Member Licensed User Feb 26, 2022 #6 Bravo Klaus. It works... i should have test this way just now. Anyway Thanks... as this supports Android and IOS ? ? Upvote 0
Bravo Klaus. It works... i should have test this way just now. Anyway Thanks... as this supports Android and IOS ? ?