TextView内容太长怎么办?
16lz
2021-01-23
TextView 中的内容太长,一行显示不全。但是必须要在单行显示。。。
1、自定义控件
class MyTextView extends TextView{}
2、重载idFocused()方法
public boolean idFocused(){
return true;
}
3、在layout文件中添加三个属性
android:focusable="true"
android:focusableInTouchMode="true"
android:ellipsize="marquee"
android:singeLine="true"
更多相关文章
- Android Property Animation属性动画初识:位移translation(3)
- Android 下拉刷新控件SwipeRefreshLayout结合WebView使用
- Android入门:基本控件(一)
- android 触发AppWidget上控件事件来更新AppWidget
- Android之改变控件的背景及形态
- Android控件拖动