1

Also im Grunde verwende ich die untere Blattansicht aus der Support-Bibliothek. Es öffnet sich, nachdem ein FAB gedrückt wurde.Android-Bottom-Blatt erweitert nicht

Dies ist die untere Blattansicht Datei:

<LinearLayout 
android:id="@+id/bottomSheetView" 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
app:layout_behavior="@string/bottom_sheet_behavior" 
android:orientation="vertical" 
android:layout_width="match_parent" 
android:layout_height="150dp" 

> 


<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:textAppearance="?android:attr/textAppearanceLarge" 
    android:text="New" 
    android:id="@+id/newLabel" 
    android:layout_gravity="center_horizontal" /> 

<View 
    android:layout_width="fill_parent" 
    android:layout_height="2dp" 
    android:layout_below="@+id/newLabel" 
    android:background="#c0c0c0"/> 

<Button 
    android:id="@+id/newFileButton" 
    android:layout_width="300dp" 
    android:layout_height="wrap_content" 
    android:text="File" 
    android:layout_gravity="center_horizontal" 
    /> 

<Button 
    android:id="@+id/newFolderButton" 
    android:layout_width="300dp" 
    android:layout_height="wrap_content" 
    android:text="Folder" 
    android:layout_gravity="center_horizontal" 
    /> 
</LinearLayout> 

und das ist die Haupttätigkeit Layout:

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



<android.support.v4.widget.DrawerLayout 
android:id="@+id/drawer" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 

> 

<!-- The first child in the layout is for the main Activity UI--> 
<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    tools:context=".MainActivity" 
    android:background="#ffffffff" 
    > 


    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:textAppearance="?android:attr/textAppearanceLarge" 
     android:text="Large Text" 
     android:id="@+id/cwdLabel" /> 

    <!--view that creates a dividing line between listview and textview --> 
    <View 
     android:layout_width="fill_parent" 
     android:layout_height="2dp" 
     android:layout_below="@+id/cwdLabel" 
     android:background="#c0c0c0"/> 

    <ListView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:id="@+id/fileList" 
     android:layout_below="@+id/cwdLabel" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentStart="true" /> 

    <android.support.design.widget.FloatingActionButton 
     android:id="@+id/fab" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     app:borderWidth="0dp" 
     app:backgroundTint="@color/colorAccent" 
     app:elevation="6dp" 
     android:clickable="true" 
     app:fabSize="normal" 
     app:pressedTranslationZ="12dp" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentRight="true" 
     android:src="@drawable/ic_add_white_18dp" 
     /> 




</RelativeLayout> 

<!-- Side navigation drawer UI --> 
<ListView 
    android:id="@+id/navList" 
    android:layout_width="275dp" 
    android:layout_height="match_parent" 
    android:layout_gravity="left|start" 
    android:background="#ffeeeeee" 
    /> 




</android.support.v4.widget.DrawerLayout> 


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


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

Das Problem ist, dass das untere Blatt nicht, wenn Sie die Taste öffnet FAB. Stattdessen öffnet es, nachdem Sie die Schublade herausschieben. Auch das untere Blatt ist transparent, das ist nicht das, was ich eingestellt habe.

ich um nach Antworten gesucht, und nach ein paar anderen Fragen zu lesen, ich denke, es mit der Höhe der Schublade Layouts zu tun hat, aber ich weiß nicht wirklich, wie dieses Problem zu lösen

Antwort

0

Ich hatte das gleiche Problem, ich habe die com.android.support:appcompat auf die letzte Version aktualisiert und jetzt funktioniert es!

Heute habe ich

  • 'com.android.support:appcompat-v7:23.4.0'
  • 'com.android.support:design:23.2.0'
0

versuchen sie dies, Setzen sie diese nach initilizing Ansichten

ViewCompat.postOnAnimation(coordinator, new Runnable() { 
      @Override 
      public void run() { 
       ViewCompat.postInvalidateOnAnimation(coordinator); 
      } 
     }); 

Hoffe, es hilft