2016-06-07 3 views
0

이것은 텍스트 뷰를 스크롤하는 xml 파일이지만 작동하지 않습니다.가로 스크롤이 가능한 텍스트 뷰가 작동하지 않음

<TextView 
    android:id="@+id/txt_join_crew" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentStart="true" 
    android:layout_centerVertical="true" 
    android:ellipsize="marquee" 
    android:focusable="true" 
    android:focusableInTouchMode="true" 
    android:marqueeRepeatLimit="marquee_forever" 
    android:paddingEnd="5dp" 
    android:paddingRight="5dp" 
    android:scrollHorizontally="true" 
    android:singleLine="true" 
    android:text="@string/join_my_crew" 
    android:textSize="@dimen/content_text_size" > 
</TextView> 

이것은 xml 코드이며 작동하지 않습니다.

+0

'textview.setHorizontallyScrolling (사실) 자바 코드를 추가해야,'동적으로 추가하고 그것을 시도. –

+0

답장을 보내 주셔서 감사합니다. 그러나 작동하지 않습니다. –

답변

1

당신의 코드가 작동하지만

TextView tv=(TextView)findViewById(R.id.txt_join_crew); 
tv.setSelected(true); 
+0

문제가 발생했거나 오류가 발생했습니다. – Ironman

+0

이것은 자동 스크롤이 아닙니다 –

+0

고맙습니다. 잘 작동합니다. –

관련 문제