0

你能帮我修复一个小错误吗?我有一个文本视图,我想在一行中水平滚动它。我已经使用了这段代码,但它不起作用。有人可以帮我吗?

<TextView
    android:id="@+id/SpeseHeader_2"
    android:layout_width="wrap_content"
    android:layout_height="fill_parent"
    android:layout_weight="1"
    android:textColor="#000000"
    android:scrollHorizontally="true"
    android:ellipsize="marquee"
    android:singleLine="true" 
    android:textAppearance="?android:attr/textAppearanceLarge" />
4

1 回答 1

1

尝试这个:

 <TextView  
    android:id="@+id/SpeseHeader_2"
    android:layout_width="fill_parent"  
    android:layout_height="40sp"  
    android:background="#000"  
    android:gravity="center"  
    android:text="horizontial scrollbar test: text1 text2 text3 ... text7 text8"  
    android:singleLine="true"
    android:marqueeRepeatLimit ="marquee_forever"
    android:ems="16"
    android:focusable="true"
    android:focusableInTouchMode="true"
    android:textColor="#FF0000"
    android:ellipsize="marquee"
    android:scrollHorizontally="true"  
    android:scrollbars="horizontal"  
    />  
于 2012-04-06T19:31:43.833 回答