안드로이드 개발을 시작한지 않마 되지 않은 개발자입니다.
HorizontalScrollView 를 사용하고 있는데 알수 없는 현상이 나타나는데 검색을 해봐도 관련된 내용을 찾을 수 없네요..
현상은 이렇습니다.
레이아웃구성은 이렇습니다.
<LinearLayout
android:id="@+id/linearLayout3"
android:orientation="horizontal"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:background="#ff00ffff">
<LinearLayout
android:id="@+id/linearGraphLabel"
android:orientation="vertical"
android:layout_marginBottom ="30dp"
android:layout_height="fill_parent"
android:layout_width="80dp"
android:background="#550011ff">
</LinearLayout>
<FrameLayout
android:id="@+id/frameGraph"
android:layout_height="fill_parent"
android:layout_width="match_parent"
android:background="#550033ff">
<HorizontalScrollView
android:id="@+id/scrollGraph"
android:fillViewport="true"
android:scrollbarAlwaysDrawHorizontalTrack="true"
android:fadingEdge="horizontal"
android:fadingEdgeLength="0dp"
android:drawingCacheQuality="high"
android:layout_marginBottom ="30dp"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/linearScroll"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<FrameLayout
android:id="@+id/frameGraphLayer"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:background="#55aaaaaa">
</FrameLayout>
</LinearLayout>
</HorizontalScrollView>
</FrameLayout>
</LinearLayout>
스크롤 뷰에 가로로 긴 커스텀 뷰를 소스상에서 생성하여 HorizontalScrollView의 LinearLayout에 추가하였습니다.
그리고 파란색부분의 LinearLayout에 추가로 커스텀 뷰를 생성하여 추가하였습니다.
여기서 스크롤뷰를 좌우측으로 움직여 보면 스크롤이 오른쪽으로 이동하게 되면서 원래 스크롤뷰의 영역을 벗어나면서
파란색 Layout을 덮어버리는 현상이 발생합니다.
제일 좌측으로 스크롤된 상태는 정상적인것처럼 보이나 스크롤하는만큼 정확하게 덮어버리네요..
고수님들 힌트를 주세요
질문을 올렸던 사람입니다.
혹시나 저와 같은 고민을 하시는 분이 계실거 같아서....
제가 스크롤뷰안에 배치한 커스컴 뷰는 surfaceview 입니다. 구글에서 찾아보니 surfaceview를 스크롤뷰안에 배치하는것은 좋지 못한(?) 방법인듯 싶네요..
surfaceview 특성상 일반 뷰와 달리 직접적인 하드웨어 제어방식에 근접한 방식이라 속도는 빠른 반면 일반 뷰처럼 사용하기 위해서는 (저와 같은 경우에 해당하는거 같네요) 직접적인 컨트롤을 해주어야 하는것 같습니다.
쩝.. -_-
안드로이드 어려워요... 아이폰 개발은 쉬울려나?




HorizontalScrollView 정렬시켜보시겟어요?
왼쪽으로....