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

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -