0

I need to place a button on top of slidingTabLayout. I used layout_below. But, it didn,t work. Please take a look at my XML and fragment code.

 <FrameLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     >

     <!-- TODO: Update blank fragment layout -->

     <Button
     android:id="@+id/charge_button"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:text="@string/charge" />

     <tabs.SlidingTabLayout
         android:id="@+id/sliding_tabs"
         android:elevation="1dp"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_below="@+id/charge_button"/>


     <android.support.v4.view.ViewPager
         android:id="@+id/view_pager"
         android:layout_height="wrap_content"
         android:layout_width="match_parent"
         app:layout_behavior="@string/appbar_scrolling_view_behavior"
         android:layout_below="@+id/sliding_tabs">


     </android.support.v4.view.ViewPager>


 </FrameLayout>

//Charge is the button name here

enter image description here

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Soumya Rauth
  • 1,163
  • 5
  • 16
  • 32

1 Answers1

-1

you must set like this Sorry i had not understood your requirement correctly now got the point you can not overlap layouts you must set title using java code by adding fragments to sliding layout with a title. https://stackoverflow.com/a/37833589/4574463

Community
  • 1
  • 1
santosh kumar
  • 2,952
  • 1
  • 15
  • 27