3
A
回答
1
你会想看看的TextView的ellipsize
属性并将其设置为“跑马灯”。这里是 Android documentation。
5
将椭圆大小设置为“字幕”的TextView不会滚动,除非它具有焦点。
您是否正在寻找滚动字幕而不管焦点?
如果是这样,您可以使用带有LinearInterpolator的TranslateAnimation为其提供一致的滚动外观。这是我使用的,它工作正常。
DisplayMetrics dm = getResources().getDisplayMetrics();
TranslateAnimation m_ta = new TranslateAnimation(dm.widthPixels, -1 * (dm.widthPixels), 0f, 0f);
m_ta.setDuration(10000);
m_ta.setInterpolator(new LinearInterpolator());
m_ta.setRepeatCount(Animation.INFINITE);
TextView m_tv = (TextView)findViewById(R.id.tvMarquee);
m_tv.startAnimation(m_ta);
+1
吓坏完美的,我知道的动画会比默认字幕的TextView平滑(这是不稳定和缓慢..)。谢谢! – leenephi 2012-09-01 15:05:19
相关问题
- 1. Android textView滚动
- 2. 在Android中滚动textview不滚动。
- 3. TextView在滚动视图不滚动 - Android
- 4. android - 如何使textview滚动?
- 5. 在android中滚动Textview
- 6. Android - 使用TextView自动滚动的ScrollView
- 7. android中的自动滚动textview
- 8. Android中的TextView滚动和动画
- 9. Android中的自动滚动textview
- 10. 在TextView Android中自动滚动文本
- 11. Android:在TextView中自动滚动文本
- 12. TextView的滚动
- 13. 滚动查看textview
- 14. 垂直自动滚动Textview
- 15. android edittext和textview一起滚动
- 16. Android Widget中的可滚动TextView
- 17. Android TextView 3行与横向滚动
- 18. android textview scrollview在布局滚动视图
- 19. Android的 - TextView滚动/之前Listview
- 20. Xamarin android textView滚动不起作用
- 21. AlertDialog中的可滚动Textview [Android]
- 22. Android TextView水平滚动不起作用
- 23. 让一个TextView滚动+ Bug的Android中
- 24. 带有滚动条和maxHeight的Android TextView
- 25. android中的不可滚动textview
- 26. Android的可滚动TextView与OnClickListener
- 27. Textview在Imageview后面滚动
- 28. 获取TextView滚动
- 29. 水平滚动TextView
- 30. TextView可滚动+ onTouchListiner
有了: 机器人:ellipsize =“跑马灯” 机器人:单线=“真” TextView的不滚动:( – laclac 2011-01-06 22:13:29