tabs layout menu not working in android -


tabs layout not working properly, tab contents not displayed.below related xml files. tabs sliding content of tabs not visible. below file app_bar_main.xml.

  <?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:fitssystemwindows="true" tools:context="com.example.shubham.tabexample.activity.mainactivity">  <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/toolbar"         android:layout_width="match_parent"         android:layout_height="?attr/actionbarsize"         android:background="?attr/colorprimary" />     <!-- app:popuptheme="@style/apptheme.popupoverlay" />-->       <!-- our tablayout display tabs  -->       <linearlayout 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:id="@+id/main_layout"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:orientation="horizontal"         tools:context=".mainactivity">          <!--  our toolbar         <android.support.v7.widget.toolbar             android:id="@+id/toolbar"             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:background="?attr/colorprimary"             android:minheight="?attr/actionbarsize"             android:theme="@style/themeoverlay.appcompat.dark.actionbar"             app:popuptheme="@style/themeoverlay.appcompat.light"/>-->           <!-- view pager swipe views -->           <android.support.design.widget.tablayout             android:id="@+id/tablayout"             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:background="?attr/colorprimary"             android:minheight="?attr/actionbarsize"             android:theme="@style/themeoverlay.appcompat.dark.actionbar" />          <android.support.v4.view.viewpager             android:id="@+id/pager"             android:layout_width="match_parent"             android:layout_height="fill_parent" />       </linearlayout>   </android.support.design.widget.appbarlayout>      </android.support.design.widget.coordinatorlayout> 

your linearlayout tablayout define outside of appbarlayout


Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -