emilsjolander / android-FlipView

A small, easy to use android library for implementing flipping between views as seen in the popular Flipboard application
Apache License 2.0
923 stars 273 forks source link

TextView inside nested ViewGroup in the pager cannot be updated properly #63

Open hrhktkbzyy opened 9 years ago

hrhktkbzyy commented 9 years ago

I just modified Emil Sjölander's demo code. I add a RelativeLayout inside the page.xml. Inside this RelativeLayout, I added in a TextView, id is textViewQuizNo.

In the getView() of FlipAdapter, I set the position no to this TextView, the same as the original TextView(id is text) which is not inside a RelativeLayout, but directly inside the FrameLayout. When I run the code, the weird thing happened: The textViewQuizNo's text is 0,1,2,0,1,2,0,1,2... when I flip the page, while the text's text is 0, 1, 2, 3, 4, 5...

I dug into Emil's code for a while, and I found a solution, please refer the detailed explanation in StackOverflow: http://stackoverflow.com/questions/32194851/emil-sj%C3%B6landers-flipview-textview-inside-nested-viewgroup-in-the-pager-cannot