问题
My app contains a ViewFlipper and in the same activity, a marquee text inside a TextView. The TextView is NOT inside the ViewFlipper. The ViewFlipper is filled programatically later. When the Viewflipper transition occurs, the marquee text resets, returning to initial position... Anyone knows why do this happen? How can I fix that?
//VIEWFLIPPER
<ViewFlipper
android:id="@+id/vfHome"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:flipInterval="5000" >
</ViewFlipper>
//...
//MARQUEE TEXT
<TextView
android:id="@+id/tvHome"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="center_vertical"
android:lines="1"
android:marqueeRepeatLimit="marquee_forever"
android:paddingTop="2dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:scrollHorizontally="true"
android:scrollbars="horizontal"
android:singleLine="true"
android:text=""
android:textColor="#EEE"
android:textSize="13dp" >
</TextView>
Thanks
来源:https://stackoverflow.com/questions/11908471/android-viewflipper-resetting-my-marquee-textview