当前位置:网站首页>Marqueetextview (running lantern)
Marqueetextview (running lantern)
2022-07-27 19:52:00 【Ashurol】
Because sometimes TextView The content is too long , Realize the status of the running lantern , If one Activity Only one is needed inside TextView, You can add the following attributes to it
android:singleLine="true"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
Need two or more , It is necessary to redefine TextView class
public class MarqueeTextview extends TextView{
public MarqueeTextview(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
public MarqueeTextview(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// TODO Auto-generated constructor stub
}
public MarqueeTextview(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
}
@Override
public boolean isFocused() {
// TODO Auto-generated method stub
return true;
}
}
Layout file TextView Label is replaced by package name category
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.xin.marqueetextview.MainActivity" >
<com.example.xin.marqueetextview.MarqueeTextview
android:id="@+id/tv_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="@string/hello_world" />
<com.example.xin.marqueetextview.MarqueeTextview
android:layout_below="@+id/tv_1"
android:id="@+id/tv_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="@string/hello_world" />
</RelativeLayout>

边栏推荐
- Virtualbox:ssh connection
- File operation protection
- [daily accumulation - 07] CUDA multi version switching
- Intel's process roadmap for the next 10 years is exposed: 1.4nm process will be launched in 2029! How?
- [basic knowledge of deep learning - 38] the difference between L1 regularization and L2 regularization
- Intel launched the world's smallest high-resolution lidar, priced at only $349
- Oracle 日期的转换
- What's new in helix QAC 2022.2, the ace code static testing tool (1)
- 首发骁龙765G!Redmi K30 5G版发布:支持5G双模120Hz屏,定价1999元起
- 【深度学习基础知识 - 38】L1正则化和L2正则化的区别
猜你喜欢

SQlife(数据库)

JS 寻找所有节点sibling childNodes children
![[basic knowledge of deep learning - 43] concept of odds ratio](/img/74/d7d1562ada4671864961721b9a1baf.png)
[basic knowledge of deep learning - 43] concept of odds ratio

GestureDetector(手势识别)

pytorch 常见报错

【深度学习基础知识 - 45】机器学习中常用的距离计算方法
![[basic knowledge of deep learning - 37] solve the imbalance between positive and negative samples](/img/71/4052607951eb52862a6fd36366f216.png)
[basic knowledge of deep learning - 37] solve the imbalance between positive and negative samples

下放三星3J1传感器:代码暗示Pixel 7人脸识别安全性将大增

ContentProvider of four components

rxbinding
随机推荐
传苹果计划以2亿美元购买JDI部分工厂
Object常用方法学习【clone和equals】
Optimization of fixed number of cycles in embedded C language
The first Xiaolong 765G! Redmi K30 5g release: support 5g dual-mode 120Hz screen, priced from 1999 yuan
应用程序池已被禁用
[basic knowledge of in-depth learning - 40] Why does CNN have more advantages than DNN in the field of images
The first in the field of mobile phone chip design in the world! Ziguang zhanrui won the international certification of tmmi4
Remember an unprepared internship interview
DatePicker(日期选择器)与TimePicker(时间选择器)
Transaction log full problem handling in sqlserver 2008
Introduction to several wireless protocols
OneNote code highlighting
【深度学习基础知识 - 49】Kmeans
发布自己的npm组件库
The valuation exceeds 15.6 billion yuan! Huaqin communication completed the round B financing of 1billion yuan! Qualcomm venture capital, Intel Capital led investment
pytorch tensor的基本函数
【深度学习基础知识 - 39】BN、LN、WN的比较
[basic knowledge of deep learning - 38] the difference between L1 regularization and L2 regularization
Application pool has been disabled
【日常积累 - 07】cuda多版本切换