문제

이 응용 프로그램을 구현하려고합니다.현재 탭이 설계되었으며 7 개 이상의 탭이 있기 때문에 너무 혼잡 해 보입니다.Tabwidget이 가로로 스크롤 할 수 있도록 어떻게 설계 할 수 있습니까?나는 시장에서 몇 가지 앱 에서이 디자인을 보았지만 내 앱에서 이것을 구현하는 방법은 어떨까요?

하나의 응용 프로그램을 사용하는 앱은 자체적으로 스크롤되는 수평 ScrollView가 있었고 특정 이미지 / 버튼을 누르면 일부 콘텐츠가 표시됩니다.그것은 내가 추측하는 탭으로 보이지 않았다.

아무도 이것에 대한 아이디어가 있습니까?

도움이 되었습니까?

해결책

Jake Wharton의 ViewPager 앱을 확인하십시오.그것이 당신이 필요로하는 정확히 일입니다.라이브러리 프로젝트이므로 프로젝트에 포함시켜야합니다.

Jakewharton / Android-ViewPagerIndicator

다른 팁

Tableayout android 디자인 라이브러리

<android.support.design.widget.TabLayout
    android:id="@+id/categories"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:tabMode="scrollable" />
.

HorizontalScrollView를 사용하여 꽤 좋은 예입니다. http://java.dzone.com/articles/scrolling-tabs-Android

<HorizontalScrollView 
    android:id="@+id/vTabs" 
    android:scrollbars="none" 
    android:layout_width="fill_parent" 
    android:layout_alignParentBottom="true"
    android:layout_height="wrap_content">
    <LinearLayout 
        android:orientation="horizontal" 
        android:background="@color/main_color_gray_dk" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content">
        <Button 
            android:enabled="false" 
            android:id="@+id/tab1" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:text="@string/popular" />
        <View 
            android:id="@id/view1" 
            android:layout_width="@dimen/pad_1dp" 
            android:layout_height="fill_parent" />
        <Button 
            android:id="@id/tab2" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:text="@string/newest" />
        <View 
            android:id="@id/view1" 
            android:layout_width="@dimen/pad_1dp" 
            android:layout_height="fill_parent"  />
        <Button 
            android:id="@id/tab3" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:text="@string/distance" />
        <View 
            android:id="@id/view1" 
            android:layout_width="@dimen/pad_1dp" 
            android:layout_height="fill_parent"  />
        <Button 
            android:id="@+id/tab4" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:text="@string/minimum"  />
    </LinearLayout>
</HorizontalScrollView>
.

텍스트를 맛으로 변경하십시오. RelatVelayout 및 AlignTopaRentBottom="TRUE" 희망이

에 도움이됩니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top