2014-12-19 5 views
1

내 응용 프로그램의 텍스트보기에 마키 기능을 적용하고 성공적으로 구현했습니다. 다음은 내가 사용한 코드입니다. 내가 텍스트 뷰는 다음 천막 기능이 작동하지 않는 작은 텍스트를 할당하는 경우 작은 텍스트를 사용하여 안드로이드의 TextView에 marqee를 추가하는 방법

<TextView android:id="@+id/latest_notification" android:layout_width="fill_parent" android:layout_height="20dp" android:ellipsize="marquee" android:focusable="true" android:focusableInTouchMode="true" android:freezesText="true" android:marqueeRepeatLimit="marquee_forever" android:paddingLeft="15dip" android:paddingRight="15dip" android:scrollHorizontally="true" android:singleLine="true" />

 mLatestNotification = (TextView) view 
      .findViewById(R.id.latest_notification); 
    mLatestNotification.setSelected(true); 
    mLatestNotification 
      .setText("Scrollable textScrollable textScrollable textScrollable textScrollable text Scrollable text"); 

조각

에서

이제 내 질문입니다. 작은 텍스트에도 차양을 적용 할 수있는 방법이 있습니까?

텍스트 크기가 큰 경우

<TextView 
     android:id="@+id/text" 
     android:layout_width="100dp" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center" 
     android:ellipsize="marquee" 
     android:marqueeRepeatLimit="marquee_forever" 
     android:singleLine="true" 
     android:text="TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView" 
     android:textAppearance="?android:attr/textAppearanceSmall" /> 

그것은에서만 작동, 당신은

답변

0

이것 봐 내 프로젝트

<TextView 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentRight="true" 
    android:ellipsize="marquee" 
    android:fadingEdge="horizontal" 
    android:lines="1" 
    android:textSize="50sp" 
    android:singleLine="true" 
    android:marqueeRepeatLimit="marquee_forever" 
    android:scrollHorizontally="true" 
    android:text="Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum." 
    android:textColor="#757575" /> 
+0

큰 텍스트를 줄 때만 작동합니다. 작은 텍스트를 위해 그것을 할 수있는 방법이 있습니까? – Ramesh

0

에서 나는 그것을 잡고 한이 코드를 사용하시기 바랍니다 감사합니다.

관련 문제