2013-02-20 3 views
1

나는 바닥 글에 텍스트보기가 있으며 바닥 글에서 그 텍스트를 스크롤하고 싶습니다. 다음은 내 코드 조각입니다.하지만 해당 텍스트는 스크롤 할 수 없습니다. 모든 몸은 사전에 나에게 감사합니다 도움이 될 수 있습니다 내 코드안드로이드에서 자동 스크롤 텍스트보기를 얻는 방법

public class Footer extends RelativeLayout{ 
    private TextView footer_TextVeiw; 
    ImageView logout; 
    public Footer(Context context, AttributeSet attrs) { 
     super(context, attrs); 
     String infService = Context.LAYOUT_INFLATER_SERVICE; 
     LayoutInflater li = (LayoutInflater) getContext().getSystemService(infService); 
     li.inflate(R.layout.footer_layout, this, true); 
     footer_TextVeiw= (TextView) this.findViewById(R.id.text_Footer); 
     footer_TextVeiw.setSelected(true); } } 

내 XML 레이아웃

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context=".Footer" > 


    <TextView 
     android:id="@+id/text_Footer" 
     android:layout_width="fill_parent" 
     android:layout_height="25dp" 
     android:layout_alignParentBottom="true" 
     android:background="#ECEFF5" 
     android:layout_centerHorizontal="true" 
     android:marqueeRepeatLimit="marquee_forever" 
     android:singleLine="true" 
     android:scrollHorizontally="true" 
     android:ellipsize="marquee" 
     android:text="@string/Footer" 
     /> 


</RelativeLayout> 
+0

가능한 중복 : http://stackoverflow.com/questions/11184054/android-auto-scrolling-text-in-textview – EvZ

답변

1

당신은 android:scrollbars="vertical" or Horizontal

+0

안녕이 함께 시도했지만 내가 위선적 인 말투 .. 단순히 텍스트 OLY 스크롤 가능하지 않은보기로 받기 –

+1

텍스트가 오버 플로우되는 경우 스크롤 막대가있는 textView ... 텍스트보기의 고정 너비를 제공하려고 시도합니다. – Pragnani

+0

감사합니다. Pragnani가 텍스트보기에서 특정 고정 폭을 제공 할 때 완벽하게 작동합니다. –

1

android:maxLines = "AN_INTEGER" 

android:scrollbars = "vertical" 

을 설정할 속성을 시도 할 수 있습니다 TextView in XML 파일에 저장하십시오. 및 사용

textView.setMovementMethod(new ScrollingMovementMethod()) 
관련 문제