안드로이드 개발 질문/답변
(글 수 45,052)
이미지 확대 축소를 구현하는데, ImageView가 확대되면 Scoll이 생겨서 이미지를 드래그 해서 벗어난 부분을
볼 수 있게 만들려고 하는데여..
ScollView 자체가 Vertical Only라는 것을 오늘 알았습니다..
그래서 HorizontalScrollView로 한번더 감싸니까 가로 스크롤은 잘 먹는데,
세로 스크롤은 ScollView 크기만큼만 스크롤 되고 전혀 되지 않더라구여;;
방법이 없을까 해서 질문드립니다 ㅠ.
레이아웃은 다음과 같아요~
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id = "@+id/imageViewVerticalScroll"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:addStatesFromChildren = "true">
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id = "@+id/imageViewHorizontalScroll"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:addStatesFromChildren = "true"
>
<ImageView android:id="@+id/fullImgView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
</ImageView>
</HorizontalScrollView>
</ScrollView>
볼 수 있게 만들려고 하는데여..
ScollView 자체가 Vertical Only라는 것을 오늘 알았습니다..
그래서 HorizontalScrollView로 한번더 감싸니까 가로 스크롤은 잘 먹는데,
세로 스크롤은 ScollView 크기만큼만 스크롤 되고 전혀 되지 않더라구여;;
방법이 없을까 해서 질문드립니다 ㅠ.
레이아웃은 다음과 같아요~
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id = "@+id/imageViewVerticalScroll"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:addStatesFromChildren = "true">
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id = "@+id/imageViewHorizontalScroll"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:addStatesFromChildren = "true"
>
<ImageView android:id="@+id/fullImgView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
</ImageView>
</HorizontalScrollView>
</ScrollView>
layout 목록중에는 둘 다 지원하는게 없는것 같더군요..
http://www.androidpub.com/49821
다른분이 올려주셨던건데 이걸 이용해 보세요.
코딩으로 구현한 layout입니다.