Let's say that a ListView has only one item (A) in the initial state, whose whole part can be displayed on the screen.
Here I'd like to add several new items (B, C and D) above A and put them outside of the screen, to keep the position of A on the screen and enable the user to scroll up the screen to see B, C and D. But without any tricks, A is moved down and B, C and D appear on the top of the screen.
The followings are graphical explanations of what I'd like to do:
- Initial state
~~~~
A <- the only item in theListView
~~~~ - What I'd like to do when B, C, D are added to the
ListView
D
C
B <- you can see B, C and D when and only when you scroll up the screen
~~~
A <- the only visible item without scrolling
~~~ - What I get so far (all of items are displayed in the screen without scrolling)
~~~
D
C
B
A
~~~
The problem is that the user can't scroll the ListView because all of items can be displayed on the screen at the same time. So any simple programmatic ways, such as scrollTo or setSelection don't seem to work. Does anyone know how doing it?
0 comments:
Post a Comment