2011-04-07 5 views
0

나는 textview를 움직이기를 원하지만, 제대로 할 성공을 얻지는 못한다. 비록 내가 몇 가지 예제를 통해 간 stackoverflow 줄었지만, 여전히 문제가 있습니다. 아무도 도와 줄 수 있니?안드로이드에서 움직이는 문자

+1

누군가가 도울 수 있는지 묻는 대신 귀하의 특정 문제에 대해 자세히 설명하십시오. –

+0

시도한 특정 문제 또는 코드와 무엇이 잘못 되었습니까? – Yahel

답변

1

보복 만들 수있는 최소 코드 -

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" > 

<TextView 
    android:id="@+id/MarqueeText" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:ellipsize="marquee" 
    android:focusable="true" 
    android:focusableInTouchMode="true" 
    android:scrollHorizontally="true" 
    android:singleLine="true" 
    android:text="This is a very long text which is not fitting in the screen so it needs to be marqueed." 
    android:textAppearance="?android:attr/textAppearanceLarge" /> 

이 당신의 보복 더 호감보기를 만들려면 : http://yhisham.blogspot.in/2012/08/android-how-to-make-marquee-ticker.html

3

나를 위해이 작동이 시도

<TextView 
       android:text="Android Marquee" 
       android:id="@+id/MarqueeText" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:singleLine="true" 
       android:ellipsize="marquee" 
       android:marqueeRepeatLimit="marquee_forever" 
       android:scrollHorizontally="true" 
       android:paddingLeft="15dip" 
       android:paddingRight="15dip" 
       android:focusable="true" 
       android:focusableInTouchMode="true" 
       android:freezesText="true"> 
     </TextView>