[# 2]…My DevelopStory
스크롤뷰를 이용하여 스크롤 만들기 ~ Make a scroll Using ScrollView
Mader
2019. 2. 8. 17:47
반응형
스크롤뷰를 이용하여 스크롤 만들기
Make a scroll using ScrollView
안드로이드에 내장된 기능 중 스크롤을 가능하게 해주는 기능이 있다.
이는 간단하게 xml에서 추가하는 것만으로도 사용이 가능하다
It has the ability to scroll among functions of AndroidStudio
This is simply it can be used just by adding in xml
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/scroll"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</ScrollView>
나는 최상위 레이아웃에 ScrollView를 만들고 그 안에 레이아웃을 넣어
전체화면이 스크롤이 가능하게 했다.
I'm make a ScrollView in top layout
Full screen was possible a scroll
<TextView
android:id="@+id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16dp"
android:scrollbars="vertical"
summary = (TextView) findViewById(R.id.summary);
summary.setMovementMethod(new ScrollingMovementMethod());
번외로 TextView에만 스크롤을 하고 싶을 경우
TextView 속성에 scrollbars="vertical"을 넣고
java단에 yourid.setMovementMothod(new ScroolingMovementMethod());를 추가하면 된다
Outside, if you want to TextView made a scroll
property of TextView added by scrollbars="vertical"
and add yourid.setMovementMothod(new ScroolingMovementMethod()); in Java
반응형