I've been wanting to create a ScrollView
that could adapt its current scroll position in respect to changes in its child's size. So that if my user has scrolled, say, 75% of the child's height at a time, they will still be at 75% of the child's updated height when it increases/decreases.
To do this, obviously my ScrollView
needs to know when its child size is being updated. This seems like a trivial task at first, but unfortunately every method I tried so far has yield no result:
- Using an
OnLayoutChangeListener
- Overriding
onLayout()
- Overriding
onSizeChanged()
- Overriding
onScrollChanged()
All of them reports size changes of the ScrollView
itself; not its child. This information is useless for me because my ScrollView
is not supposed to change sizes.
Any feedback will be greatly appreciated.
p.s., I understand that this answered question might looks similar to mine. But my case demands no intervention of components other than the ScrollView
itself, while the question above needs the ScrollView
to be notified by an outside entity (presumably an Activity
).