2016-05-23 11 views
0

ich das folgende Layoutein Fragment auf der viewpager Aufruf überlappt einander

<?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" 
    android:id="@+id/coordinator_bracket_activity" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <FrameLayout 
     android:id="@+id/activity_fragment" 
     android:layout_height="match_parent" 
     android:layout_width="match_parent"> 
    </FrameLayout> 
    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical"> 

     <include 
      android:id="@+id/app_bar_bracket_activity" 
      layout="@layout/app_bar" /> 

      <android.support.design.widget.TabLayout 
       android:id="@+id/tabs" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:foregroundTint="@color/colorAccent" 
       app:tabMode="fixed" 
       app:tabMaxWidth="0dp" 
       app:tabGravity="fill"/> 

      <mypackage.NonSwipeViewPager 
       android:id="@+id/tabs_pager" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_weight="1"/> 
    </LinearLayout> 
</android.support.design.widget.CoordinatorLayout> 

Die nonswipeviewpager war nur eine benutzerdefinierte Klasse, wo ich eine viewpager geerbt zu ein paar Sachen zu deaktivieren haben.

Wie auch immer, ich habe eine Schaltfläche in meiner App-Leiste, die ein Fragment aufrufen muss, das den gesamten Bildschirm abdecken muss. Ich würde es nennen und ein Fragment in das Rahmenlayout einfügen. Es funktionierte, bevor ich einen Viewpager für Tab-Layouts hinzugefügt habe. Jetzt bin ich mir nicht sicher, wie ich mit dem Viewpager umgehen soll.

FragmentTransaction ft = mFM.beginTransaction(); 
        mCustomFragment = CustomFragment.newInstance(mObject, mListOfObjects()); 
        ft.replace(R.id.activity_fragment, mCustomFragment , "CustomFragment"); 
        ft.addToBackStack(null); 
ft.commit(); 

Dies ist auf meinem Klicklistener dieser Schaltfläche in der App-Leiste.

Gedanken?

Antwort

Verwandte Themen