2017-06-17 3 views
0

Ich verwende dieses Layout, um die Fragmente in die Seite zu laden, aber wenn ich das auf dem Gerät starte, sieht es so aus.Koordinatenlayout Überlappender Container

enter image description here

Unten ist mein code.Any vorschlagen, warum framelayout überlappende wird das Layout koordinieren. Vielen Dank für Hilfe :)

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:elevation="7dp"> 

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 

    <android.support.design.widget.CoordinatorLayout xmlns:app="http://schemas.android.com/apk/res-auto" 
     xmlns:tools="http://schemas.android.com/tools" 
     android:id="@+id/cl_root_inner_main" 
     android:layout_width="match_parent" 
     android:layout_height="@dimen/toolbar_height" 
     android:fitsSystemWindows="true"> 

     <android.support.design.widget.AppBarLayout 
      android:id="@+id/tool_rl" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:theme="@style/AppTheme.AppBarOverlay"> 

      <android.support.v7.widget.Toolbar xmlns:app="http://schemas.android.com/apk/res-auto" 
       android:id="@+id/toolbar" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:background="@color/colorPrimary" 
       android:titleTextColor="@color/white" 
       app:popupTheme="@style/AppTheme.PopupOverlay"> 

       <RelativeLayout 
        android:id="@+id/buttonsview" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content"> 


        <ImageView 
         android:id="@+id/btnBack" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:layout_alignParentStart="true" 
         android:layout_centerVertical="true" 
         android:padding="@dimen/x10" 
         android:src="@drawable/ic_arrow_back" /> 


        <TextView 
         android:id="@+id/fragtitle" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:layout_centerHorizontal="true" 
         android:layout_centerVertical="true" 
         android:text="@string/select_district" 
         android:textColor="@color/white" 
         android:textSize="20sp" 
         android:visibility="invisible" /> 

        <Button 
         android:id="@+id/btnPost" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:layout_alignParentStart="true" 
         android:layout_centerVertical="true" 
         android:layout_marginEnd="@dimen/x10" 
         android:layout_gravity="center_horizontal" 
         android:text="@string/post" 
         android:textColor="@color/white" 
         android:textSize="12sp" 
         android:theme="@style/blue_button" /> 

       </RelativeLayout> 


      </android.support.v7.widget.Toolbar> 
     </android.support.design.widget.AppBarLayout> 
    </android.support.design.widget.CoordinatorLayout> 


    <FrameLayout 
     android:id="@+id/container" 
     android:background="@color/orange" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" /> 
</LinearLayout> 

Antwort

0

Dies ist ein XML-Koordinator Layout verwenden, ich denke, das Ihnen helfen wird,

<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.software.products.ui.activity.ToolbarUsedActivity" 
    android:layoutDirection="rtl"> 

    <android.support.design.widget.AppBarLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:theme="@style/AppTheme.AppBarOverlay"> 

     <--!just use toolbar here--> 

     <com.software.android.view.ddToolbar 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      android:background="?attr/colorPrimary" 
      app:popupTheme="@style/AppTheme.PopupOverlay" /> 

    </android.support.design.widget.AppBarLayout> 


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

</android.support.design.widget.CoordinatorLayout> 
Verwandte Themen