Twing90
Twing90

Reputation: 417

android scrollHorizontally

Can you help me to fix a little bug? I have a textview and I want to scroll it horizontally in a single line. I have used this code but it doesn't work. Can somebody help me please??

<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" />

Upvotes: 0

Views: 1327

Answers (1)

ρяσѕρєя K
ρяσѕρєя K

Reputation: 132982

try this:

 <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"  
    />  

Upvotes: 1

Related Questions