在Android中要显示跑马灯是比较容易的,只要设置2个属性就可以了: <?
xml version="1.0" encoding="utf-8"
?>
< LinearLayout xmlns:android ="http://schemas./apk/res/android" android:orientation ="vertical" android:gravity ="center_vertical" android:background ="@drawable/f_background" android:layout_width ="fill_parent" android:focusable ="true" android:layout_height ="50px" > < TextView android:id ="@+id/info_text" android:focusable ="true" android:layout_width ="fill_parent" android:layout_height ="wrap_content" android:text ="test marquee ![]() ![]() ![]() ![]() ![]() ![]() android:textColor ="@color/black" android:singleLine ="true" android:ellipsize ="marquee" android:marqueeRepeatLimit ="3" android:textSize ="18sp" /> < TextView android:id ="@+id/date_text" android:layout_width ="fill_parent" android:layout_height ="wrap_content" android:layout_gravity ="bottom" android:textColor ="@color/gray" android:text ="2010/05/28" android:textSize ="12sp" /> </ LinearLayout >
<?
xml version="1.0" encoding="utf-8"
?>
< LinearLayout xmlns:android ="http://schemas./apk/res/android" android:orientation ="vertical" android:gravity ="center_vertical" android:background ="@drawable/zixun_background" android:layout_width ="fill_parent" android:addStatesFromChildren ="true" android:layout_height ="50px" > < TextView android:id ="@+id/info_text" android:focusable ="true" android:layout_width ="fill_parent" android:layout_height ="wrap_content" android:text =" " android:textColor ="@color/black" android:singleLine ="true" android:ellipsize ="marquee" android:marqueeRepeatLimit ="3" android:textSize ="18sp" /> < TextView android:id ="@+id/date_text" android:layout_width ="fill_parent" android:layout_height ="wrap_content" android:layout_gravity ="bottom" android:textColor ="@color/gray" android:text ="2010/05/28" android:textSize ="12sp" /> </ LinearLayout > |
|
来自: shaobin0604@1... > 《Android》