This is the standard behaviour of the scroll view. It is known as over scroll.
No, not overscroll.
It is to indicate that there IS text in that direction... not that it is the END of text in that direction. Overscroll only shows when you REACH the end.
I want a thing which looks like it's illuminated by an LED at the top of the screen only if there is text available to scroll in the 'up' direction. At the same time I want the same kind of LED indicator at the bottom of the ScrollView which shows that there is text available to scroll in THAT direction.
So, at first, if there's no text in either direction because the text is smaller than the ScrollView, neither indicator are 'lit'.
If he text IS bigger than the ScrollView. at first, there would be no text in the 'Up' direction, so the top LED would be Off. However, there is text in the 'down' direction; so the 'bottom' LED is now on.
Once you scroll to the end of the text, the bottom indicator would turn off because there is no longer any text in the 'down' position; but the top indicator is On because there is text in that direction.
...
I almost have it working. I created two png images with transparent backgrounds and a curved faded purple color. I saved them out as top.png and bottom.png and have positioned them properly using a Layout Script so the top one is centered at the top of the ScrollView, the bottom image is centered at the bottom of the ScrollView.
I have all of them working properly except for the bottom indicator shutting-off when it reaches the end of the text.
I can't figure out how one tells that the ScrollPos position is at the largest ScrollPos Position.
The ScrollPos number doesn't seem to have any relationship at all with the text height, or the EditTextBox.Text.Height. or even the height that was returned from the StringUtils.MeasureMultilineTextHeight() function.
I am doing the following, for example:
pnlWB.LoadLayout("lessons")
scvWBLesson.Panel.LoadLayout("edtWBLesson")
EditTextWBLesson.Gravity = Gravity.Top
EditTextWBLesson.Top = 0
EditTextWBLesson.Height = scvWBLesson.Height
scvWBHeight = scvWBLesson.Height
pnlWB.Visible=False
So, I have the ScrollView embedded in the "lessons" Layout.
I have the EditText in a separate Layout and attach it to the ScrollView.
scvWBHeight is memorized so I know how tall the ScrollView used to be before I change it to equal the text height.
I later load the Text (called TheRest) from a .txt file and I call StrUtils to figure-out the Height of the Multiline Text.
scvWBTextHeight = StrUtils.MeasureMultilineTextHeight(EditTextWBLesson, TheRest)
In my ChangeScroll sub:
==========================================
Sub scvWBLesson_ScrollChanged(Position AsInt)
IfDoScrollPosThen
IfPGDebugging4ThenLog(" +++ Begin of scvWBLesson_ScrollChanged()")
IfPGDebugging4ThenLog("scvWBLesson_ScrollChanged() - Position = " & Position)
SaveWBScrollPos(Position, WBNumber)
IfDoGlowThen
If Position < 20Then
ImageViewWBTopGlow.Visible = False
Else
ImageViewWBTopGlow.Visible = True
EndIf
IfPGDebugging4ThenLog("scvACIMChapter_ScrollChanged() - scvWBHeight = " & scvWBHeight)
IfPGDebugging4ThenLog("scvACIMChapter_ScrollChanged() - scvWBTextHeight = " & scvWBTextHeight)
EndIf
DoEvents
IfPGDebugging4ThenLog(" --- End of scvWBLesson_ScrollChanged()")
IfPGDebugging4ThenLog(" ")
EndIf
End Sub
=================================================
When I scroll to the end of the text, scvWBHeight = 1260
scvWBTextHeight = 3398
And, the highest ScrollPos that you can reach is 2130
I don't understand the relationship between ScrollPos and, either the text height, or the ScrollView height?
Anybody know the relationship? I need to compute something that becomes TRUE when ScrollPos gets to about 2125 so I can turn off my 'Down' LED indicator.