1. ScrollView를 Root로 선언

2. Scrollview의 child의 LinearLayout의 height값을 wrap_content로  선언한다.

3. 앞의 LinearLayout의 child LinearLayout의 height값을 절대값은스크롤의 총 height값을 기재한다. 

   이 LinearLayout의 layout_weight값을 준다.(LinearLayout의 Root가 됨)


소스코드 예)


<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:orientation="vertical">

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="1200dip"
android:layout_weight="1"
android:background="@android:color/transparent"
android:focusable="false"
android:orientation="vertical"
android:visibility="visible"
android:weightSum="1">


'개발지식창고 > Android_Java' 카테고리의 다른 글

FLAG_ACTIVITY 사용법  (0) 2018.06.21
안드로이드 기기 해상도  (0) 2018.06.20
Retrofit 사용 방법  (0) 2018.06.17
폰트 사이즈 px to dp  (0) 2018.06.17
안드로이드 액션바 다루기  (0) 2018.06.13
Posted by 모과이IT
,