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

HorizontalScrollView 의 각 이미지들에 관련해서 질문있습니다. [closed]

0 추천

 

안녕하세요.

이미지 부분이 왜 안넘어가는지 잘 모르겠습니다.

HorizontalScrollView 부분에서 지정한 이미지들이 왜 가로로 스크롤이 안되는지 잘 모르겠습니다.

각 이미지의 id값을 주어서, 하나하나 switch문에서 넣으려고 만들었는데,이상하게도

이미지에 id로 지정하고 나서 switch문에 추가한 뒤에, 원래는 가로로 움직이던 HorizontalScrollView가 작동

을 하지 않습니다.. 어떤 이유에서 일까요 ㅠ 이것이 해결되면, 아래의 switch문의 case 1,2,3,4에는 이와 같이

하면 될것 같아서 그부분은 생략을 하였습니다..

왜 안되는지 이유를 잘 모르겠는데.. 한번 아래에 소스를 한번 첨부해 보았습니다.

8000자가 넘는 부분은, 아래의 답변 부분에 추가해 보았습니다.

 

< first_movie 부분의 .xml 파일입니다. >

<HorizontalScrollView
    android:id="@+id/HorizontalScrollView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/Eight_LinearLayout"
    android:layout_marginTop="10dp"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true">

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

    <ImageView
        android:id="@+id/ScrollView_Image1"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        />
    <ImageView
        android:id="@+id/ScrollView_Image2"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        />

    <ImageView
        android:id="@+id/ScrollView_Image3"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        />

    <ImageView
        android:id="@+id/ScrollView_Image4"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        />

    <ImageView
        android:id="@+id/ScrollView_Image5"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        />


</LinearLayout>

</HorizontalScrollView>

 

 

질문을 종료한 이유: 문제를 해결했습니다. 단순한 변수 실수였습니다. 감사합니다.
공산당 (1,960 포인트) 님이 2016년 11월 2일 질문
공산당님이 2016년 11월 2일 closed
해결 했습니다. 감사합니다.
해결했습니다. 감사합니다.
...