TextView 에서 스크롤 기능 추가

 

XML 부분 의 내용

 

<TextView

android:text="aaaaaaaaaaaaaaaaaaaaaaaa\n

              abbbbbbbbbbbbbbbbbbbbbbbaa\n

              ccccccccccccccac\n

              eeeeeeeeeeeeeeee\n

              errrrrrrrrrrrrrrrrr"

             

android:id="@+id/txt01"

android:layout_width="wrap_content"

android:layout_height="50px"

></TextView>

 

 

Activity 부분 (java)

 

public class MainActivity extends Activity {

    /** Called when the activity is first created. */

    @Override

    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.main);

            TextView txt01=(TextView)findViewById(R.id.txt01); 

//스크롤 가능

            txt01.setMovementMethod(new ScrollingMovementMethod());                         

    }

}

 

 

 

'Android' 카테고리의 다른 글

[Android]Layout 뷰의 기능들...  (0) 2012.05.25
[Android]CP(Content Provider)  (0) 2012.05.24
[Android]SQLite 접근하기  (0) 2012.05.23
[Android]SQLite Manager 설치  (0) 2012.05.23
[Android]안드로이드 이벤트 종류와 방법  (0) 2012.05.21