Android实现跑马灯效果的方法
本文实例讲述了Android实现跑马灯效果的方法。分享给大家供大家参考。具体如下:
运行效果截图如下:
直接在布局里写代码就好了:
<TextView android:id="@+id/menu_desc" android:layout_width="300dip" android:layout_height="wrap_content" android:text="温馨提示:左右滑动更改菜单,点击进入" android:textColor="@color/white" android:textSize="22dip" android:singleLine="true" android:ellipsize="marquee" android:focusable="true" android:focusableInTouchMode="true" android:scrollHorizontally="true" android:marqueeRepeatLimit="marquee_forever" android:layout_centerHorizontal="true" android:layout_centerVertical="true" > </TextView>
主要是这几行:
android:singleLine="true"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:scrollHorizontally="true"
android:marqueeRepeatLimit="marquee_forever"
希望本文所述对大家的Android程序设计有所帮助。
相关文章
Android Location服务之LocationManager案例详解
这篇文章主要介绍了Android Location服务之LocationManager案例详解,本篇文章通过简要的案例,讲解了该项技术的了解与使用,以下就是详细内容,需要的朋友可以参考下2021-08-08Android通过命令连接wifi的方法(解决usb不能用问题)
这篇文章主要介绍了Android通过命令连接wifi的方法(解决usb不能用的情况),本文通过实例代码给大家介绍的非常详细,具有一定的参考借鉴价值,需要的朋友可以参考下2020-02-02Android中ToggleButton开关状态按钮控件使用方法详解
这篇文章主要为大家详细介绍了Android中ToggleButton开关状态按钮控件的使用方法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下2017-08-08
最新评论