마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

스크롤뷰와 리니어레이아웃에 관한 질문입니다.

0 추천

익스펜더블 리스트뷰를 리니어레이아웃으로 구현중하려고 하는데요..

일단 XML 구성은 대충 이렇습니다.

 

 

android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true" >
 
<LinearLayout
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="2"
android:orientation="vertical" >
 
<LinearLayout
android:id="@+id/ll_1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal" >
</LinearLayout>
 
<LinearLayout
android:id="@+id/ll_hide"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="test"
android:textSize="30sp" />
</LinearLayout>
 
<LinearLayout
android:id="@+id/ll_2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal" >
</LinearLayout>
 
</LinearLayout>
</ScrollView>
 
 
 
스크롤뷰는 weightSum이 2인데.. 그니까 화면을 반으로 갈라논거죠.
 
xml상에 가운데 레이아웃은 visiblity가 gone상태로 가려져있고 자리차지도 안하는데..
 
맨 위 레이아웃을 클릭시에 두번째 레이아웃 visiblity값이 visible이 되면서 추가가 되고
 
기존 레이아웃들 크기 그대로있고 두번쨰 레이아웃만 추가되서 스크롤이 이루어지는걸 하는데요..
 
근데 아무리 해도 안되네요...ㅠㅠ방법을 모르겠습니다. 고수님들 도움좀부탁드려요

 

katoro (340 포인트) 님이 2013년 4월 23일 질문
katoro님이 2013년 4월 23일 수정

1개의 답변

0 추천
질문이 난해하게 되어 있네요. 사진 같은 거 첨부 해 주세요.
센스가이 (2,010 포인트) 님이 2013년 4월 29일 답변
...