1

예를 들어 제공되는 것처럼 보이게하려면 탐색 표시 줄 아이콘 (햄버거)을 작업 표시 줄에서 탭 레이아웃으로 이동해야합니다. 목록 스크롤에서 수행해야합니다. 액션 바에서 뷰를 탭 레이아웃으로 옮길 수 있습니까?이동 탐색 창 아이콘 (햄버거)

당신은이 같은 도구 모음에 tabLayout을 포함 할 수 Expected result

+0

당신은 사용자 정의 탭보기를 사용할 수 있습니다 이미지 클릭 한 다음 왼쪽 클릭 메뉴를 여는 방법 호출 –

+0

툴바 구현 –

답변

1

작업 표시 줄 Action bar

예상 결과 :

<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <android.support.design.widget.AppBarLayout 
     android:id="@+id/app_bar" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 

     <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      app:layout_collapseMode="pin" 
      android:background="@color/colorPrimary" 
      android:layout_weight="1"> 
      <android.support.design.widget.TabLayout 
       android:id="@+id/tabs" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:layout_gravity="top" 
       app:tabIndicatorColor="@color/colorAccent" 
       app:tabMaxWidth="0dp" 
       app:tabGravity="fill" 
       app:tabMode="scrollable" 
       android:background="@color/colorPrimary" /> 
     </android.support.v7.widget.Toolbar> 
    </android.support.design.widget.AppBarLayout> 

    <android.support.v4.view.ViewPager 
     android:id="@+id/viewpager" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     app:layout_behavior="@string/appbar_scrolling_view_behavior" /> 

</android.support.design.widget.CoordinatorLayout>