我想要一个带水平滚动的简单TextView,我知道我使用HorizontalScrollview,我希望文本能够连续自动滚动。这可能吗?
答案 0 :(得分:4)
您可以在TextView属性中使用android:ellipsize =“marquee”或通过实现自己的动画
答案 1 :(得分:1)
这是仅使用XML自动滚动文本视图的小例子,无需编写Java代码。希望你会喜欢!自己尝试,很容易执行
试试这个:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:scrollHorizontally="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit ="marquee_forever"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="This is small example for auto scroll text view simply using XML, no need to code Java. Hope you like it! Try it on your own, it is very easy to perform" />
此处文字会自动滚动,您将获得无限滚动。玩得开心!