여러분! 네비게이션 서랍이있는 액티비티 내의 FrameLayout 컨테이너에 조각이 있습니다. 조각에 TabLayout이 있습니다. 그리고 알 수 있듯이 액티비티의 툴바는 조각의 TabLayout에 그림자를 떨어 뜨리는 문제점이 있습니다. 단편에서 액세스 할 수 없기 때문에 활동의 AppBar 레이아웃에 TabLayout을 배치하고 싶지 않습니다. 또한 다른 곳에서는 그 TabLayout이 필요하지 않습니다.Toobar가 TabLayout에 그림자를 드리운다
이 내 activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/mainNavigationView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" />
입니다 그리고 이것은 app_bar_main.xml
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/loginToolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways|snap"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/mainFragmentContainer"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
이3210
나는 또한 당신이 어떤 생각을 가지고 있습니까 내가 ViewPager내 조각에서 목록을 스크롤 할 때 도구 모음 숨기려 fragment_by_day_schedule.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<android.support.design.widget.TabLayout
android:id="@+id/byDayTabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabBackground="?attr/colorPrimary"
app:tabMode="scrollable" />
<android.support.v4.view.ViewPager
android:id="@+id/byDayViewPager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
입니다 나는 어떻게 그것을 얻을 수 있습니까?
당신이 당신이 도구 모음 안에 넣어 경우 조각에서 tablayout에 액세스 할 수 없습니다 생각하게? 솔직히 말해서 툴바 안에 탭이있는 것이 훨씬 좋고 훨씬 더 널리 이해되는 패턴이라고 생각합니다. 또한 뷰 페이지 위로 이동하면서 툴바를 숨기는 효과를 얻을 수 있습니다. – gaara87
내 대답을 다시 확인하십시오. 두 번째 질문을 업데이트했습니다. –