admin管理员组

文章数量:1400572

I have created BottomNavigationView with four fragments in it. also i have added TabLayout in one of four fragment but while running app i am getting action bar size space between TabLayout and Activity's ActionBar. below attached screenshot for your reference, how should i remove that space. here's my fragment code

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
     xmlns:android=";
     xmlns:app=";
     android:layout_height="match_parent"
     android:layout_width="match_parent">

    <com.google.android.material.tabs.TabLayout
         android:layout_height="wrap_content"
         android:layout_width="match_parent"
        android:fitsSystemWindows="true"
         android:id="@+id/fragment_fo_rounds_tabs" />

    <androidx.viewpager.widget.ViewPager
         android:layout_height="match_parent"
         android:layout_width="match_parent"
         app:layout_behavior="@string/appbar_scrolling_view_behavior"
         android:layout_below="@id/fragment_fo_rounds_tabs"
         android:id="@+id/fragment_fo_rounds_view_pager" />

</RelativeLayout>

screenshot image

I tried adding Toolbar and TabLayout inside AppbarLayout in layout then adding ((AppCompatActivity)getActivity()).setSupportActionBar(toolbar); in fragments onCreateView but it doesn't work.

本文标签: androidHow to remove extra space between action bar and tablayoutStack Overflow