2013-07-30 6 views
0

작성중인 앱의 경우, 제한된 공간으로 인해 더 커질 수없는 몇 가지 필드가 있습니다. 이런 이유로 필드를 계속해서 스크롤하고 싶습니다. 예를 들어 RDS 정보가 스크롤되는 자동차 라디오에서 가끔 발견되는 비트입니다. Android를 사용하여 가능합니까? 그러나, 이것은 내가하고 싶은 일을하지 않습니다EditText를 가로로 계속 스크롤하십시오.

myEditText.setScroller(new Scroller(this)); 
myEditText.setMaxLines(1); 
myEditText.setHorizontalScrollBarEnabled(true); 
myEditText.setMovementMethod(new ScrollingMovementMethod()); 

: 난 이미 ScrollerMovementMethod를 사용하여 시도했습니다. 이것은 내 편집 텍스트입니다 :

<EditText 
android:id="@+id/pedigreeLineAEditText" 
android:layout_width="match_parent" 
android:layout_height="@dimen/line_height" 
android:clickable="false" 
android:cursorVisible="false" 
android:focusable="false" 
android:focusableInTouchMode="false" 
android:inputType="none" 
android:singleLine="true" 
android:textSize="@dimen/text_size" /> 
+1

당신이 오른쪽 ... 왼쪽에서 오른쪽으로 이동하는 애니메이션을 의미 스크롤하여 볼 수있는 다른 답변에서였다? 그런 다음 [this link] (http://stackoverflow.com/a/16371310/2345913)를 확인하십시오. – CRUSADER

+0

@CRUSADER 님, 감사합니다. 이제 전체 화면을 스크롤하지 않도록 코드를 수정해야하지만, 일부만 수정하면됩니다.하지만 그 부분에서 성공할 것입니다. – koesie10

+0

이 질문을 확인하십시오 http://stackoverflow.com/questions/3332924/textview-marquee-not-working –

답변

0

EditText가되어야합니까? 그렇지 않으면 이런 식으로 시도 할 수 있습니다.

<TextView 
android:text="START | lunch 20.00 | Dinner 60.00 | Travel 60.00 | Doctor 5000.00 | lunch 20.00 | Dinner 60.00 | Travel 60.00 | Doctor 5000.00 | END" 
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 Marquee not working

+0

이것은 내가 의미하는 바가 아니며, 티커와 같은 것을 의미합니다. – koesie10

+0

그러면 천막과 같은 것이 필요합니다. 내 편집을 보아라. – KBusc

관련 문제