正常情况下跑马灯效果只需要在TextView中添加android:ellipsize="marquee" android:singleLine="true" android:focusable="true"属性就可以了,不过这个方法要求指定的TextView必须要获取焦点,而在ListView中这个焦点的获取就变得疑惑了. 解决的方法按照惯例分三步: 1.作为子控件的TextView只添加android:ellipsize="marquee" android:singleLine="true"不添加android:focusable="true"属性 2.在ListView中添加android:focusable="true"属性 3.在代码中为需要显示走马灯效果的那个TextView添加setSelected(true);方法

相关文章:

  • 2021-07-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-20
  • 2022-12-23
猜你喜欢
  • 2021-08-22
  • 2022-12-23
  • 2022-01-25
  • 2021-07-14
  • 2022-12-23
相关资源
相似解决方案