나는 안드로이드를 처음 접했고 이에 대한 해결책을 찾고 있지만 지금까지는 아무런 운이 없었습니다. 아래 그림과 같은 레이아웃을 만들고 싶습니다.화면의 크기 인 horizontalScrollView 내부의 레이아웃
화면의 크기 인 linearLayout을 원합니다. 화면의 크기이기도하지만 화면이 아닌 다른 linearLayout을 사용하고 싶습니다. 그런 다음 두 개의 가상 "화면"사이를 스크롤 할 수 있습니다.
가 나는 멋진 스냅 효과를 얻을 수 있도록있는 ScrollView 클래스를 확장하는 방법을 설명 흥미로운 기사가, 그래서 나는이 작업을 얻을 수 있다면, 내 응용 프로그램이 많은 집 사이에 스크롤처럼 느낄 것이다 화면.
가중치에 대해 읽었으며 scrollView의 fillViewport = "true"에 대해서도 읽었습니다. linearLayouts에 화면을 채우려면 horizontalScrollView와 함께 이들을 어떻게 사용하는지 이해할 수 없습니다. fill_parent와 wrap_content의 모든 종류의 조합을 시도했지만 아무 소용이 없습니다.
이 기능은 화면 변동성을 염두에두고 하위보기 (각 "화면"의 요소)를 만드는 한 다른 화면이있는 장치간에 앱의 이식성을 떨어 뜨리지는 않습니다. 불행하게도
<HorizontalScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/HorizontalScrollView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fillViewport="true">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<EditText
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/txtTestBox"
>
</EditText>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Button 1"
/>
</LinearLayout>
</LinearLayout>
</HorizontalScrollView>
, 근처에도 내가 찾던로하지 않습니다
는 여기에 내가 시도 된 XML의 간단한 예입니다. 잘하면이 일을 할 수 있습니다 ...
어떤 도움이나 제안을 주셔서 감사합니다.
내가 언급 한 '스냅'코드에 대한 링크를 배치하는 것이 도움이 될 것이라고 생각했습니다. http://blog.velir.com/index.php/2010/11/17/android-snapping-horizontal-scroll/ – paradoX
구현하고자하는 기능의 추가 예제는 다음에서 찾을 수 있습니다. 안드로이드 용 Firefox 모바일 앱. 페이지의 왼쪽에있는 탭 막대 (화면을 벗어날 때까지 화면에서 벗어남)는 화면의 정확한 크기 인 하위보기가있는 스크롤 가능한 화면을 어떻게 든 생성합니다 (크기가 "화면"을 생성 함). 사용자가 스크롤하면 탭과 화면을 볼 수 있습니다. 바라기를 이것은 나의 질문을 명확하게한다. – paradoX