Android: ViewFlipper resetting my marquee TextView

左心房为你撑大大i 提交于 2019-12-10 14:49:38

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!