Click here to Skip to main content
15,893,722 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to include multiple layout in Framelayout but the Framelayout is not shown in output.I have implemented drawerlayout using navigation view in which one Activity is handling multiple fragments, in one of the frames inside which i want to implement tablayout.Can anyone suggest what to do in this situation?

What I have tried:

XML
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:addStatesFromChildren="true"
    android:layout_width="match_parent"
    android:layout_height="match_parent">


        <include layout="@layout/toolbar"/>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <Button android:layout_height="wrap_content"
                android:layout_width="150dp"
                android:background="@color/ColorBlue"
                android:layout_marginTop="68dp"
                android:id="@+id/button"
                android:text="ORDER"
                android:layout_alignParentTop="true"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true"
                android:layout_marginLeft="10dp"
                android:layout_marginStart="10dp" />

            <Button android:layout_height="wrap_content"
                android:layout_width="150dp"
                android:background="@color/ColorBlue"
                android:id="@+id/button2"
                android:text="QUOTES"
                android:layout_alignBaseline="@+id/button"
                android:layout_alignBottom="@+id/button"
                android:layout_alignParentRight="true"
                android:layout_alignParentEnd="true"
                android:layout_marginRight="10dp"
                android:layout_marginLeft="20dp"/>


            <android.support.design.widget.TabLayout
                android:id="@+id/tabLayout1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/ColorBlue"
                android:layout_marginTop="5dp"
                android:layout_below="@+id/button"
                app:tabMode="scrollable"
                android:minHeight="?attr/actionBarSize"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true"/>

            <android.support.v4.view.ViewPager
                android:layout_height="wrap_content"
                android:layout_width="match_parent"
                android:layout_below="@+id/search_view"
                android:id="@+id/viewp"/>

            <SearchView
                android:layout_width="400dp"
                android:layout_height="wrap_content"
                android:layout_below="@+id/tabLayout1"
                android:queryHint="Search"
                android:background="@drawable/background"
                android:id="@+id/search_view" />
        </RelativeLayout>
</FrameLayout>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900