0

Es gibt einen zusätzlichen Platz in CardView .... Ich habe versucht, das lineare Layout darüber zu entfernen, aber das ist der Inhalt in ihm verzerrt n passtSystemWindows Attribut auch nicht funktioniert.So entfernen Sie zusätzlichen Platz in der Kartenansicht über

n ist es für beide Pre-und Post Lutscher Versionen

space over card view

 <LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    android:layout_gravity="fill_vertical"> 
    <include layout="@layout/app_bar"/> 
    <Space 
     android:layout_width="match_parent" 
     android:layout_height="2dp" 
     android:layout_gravity="center_horizontal"/> 
    <ListView 
     android:stackFromBottom="true" 
     android:layout_gravity="fill_vertical" 
     android:id="@+id/messages_list" 
     android:layout_weight="100" 

     android:layout_width="match_parent" 
     android:layout_height="match_parent" 

     android:divider="@null"/> 


    <LinearLayout 
     android:animateLayoutChanges="true" 
     android:layout_gravity="bottom" 
     android:id="@+id/linearsend" 
     android:fitsSystemWindows="true" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical"> 

     <android.support.v7.widget.CardView 
      android:layout_width="match_parent" 
      xmlns:app="http://schemas.android.com/apk/res-auto" 
      app:cardCornerRadius="3dp" 
      android:layout_gravity="fill_horizontal" 
      android:layout_height="60dp" 

      android:elevation="2dp" 
      android:background="#c8ffffff"> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:orientation="horizontal" 
       android:scrollbars="vertical"> 
       <ImageView 
        android:id="@+id/imageSimly" 
        android:layout_margin="4dp" 
        android:layout_marginEnd="12dp" 
        android:layout_width="33dp" 
        android:layout_height="33dp" 
        android:layout_gravity="center|start" 
        android:src="@drawable/ic_mood_24dp"/> 
       <hani.momanii.supernova_emoji_library.Helper.EmojiconEditText 
        xmlns:emojicon="http://schemas.android.com/apklib/hani.momanii.supernova_emoji_library.Helper.EmojiconEditText" 
        android:id="@+id/new_messagee" 
        android:layout_gravity="center" 
        android:gravity="center_vertical" 
        android:layout_width="250dp" 
        android:layout_height="wrap_content" 
        android:textColor="#778BB0" 
        android:singleLine="true" 
        android:textColorHint="#778BB0" 
        android:hint="type a message..." 
        android:textSize="18sp" 
        emojicon:emojiconSize="20sp" /> 
       <android.support.design.widget.FloatingActionButton 
        android:layout_gravity="center|end" 
        android:elevation="2dp" 
        android:layout_width="40dp" 
        android:layout_height="40dp" 
        android:scaleType="center" 
        android:id="@+id/fabSend" 
        android:src="@drawable/ic_send_24dp" 

        /> 


      </LinearLayout> 


     </android.support.v7.widget.CardView> 


    </LinearLayout> 
</LinearLayout> 
+0

Versucht das Entfernen von 'android: fitsSystemWindows =" true "' von LinearLayout? Wie sieht es aus? – jayeshsolanki93

+0

ya danach, wenn ich etwas in editText schreiben möchte, wird die Box nicht über der Tastatur angezeigt ... n thts, warum ich das Attribut –

+0

putted Überprüfen Sie, ob dies http://stackoverflow.com/questions/32742724/recyclerview-is hilft -ausschneiden-der-letzte-Artikel – jayeshsolanki93

Antwort

0

Wenn einige Stelle fest, bessere Lösung Bitte benachrichtigen

Also, ich habe eine temperory Lösung, um es .. wie @Jay Patel sagte, ich eine Idee und setzen die äußerste Layout Layout zu gestalten, wie der Raum Ich denke, ist aufgrund Listenansicht N (I gesetzt haben keinen Spielraum unten)

So ist der Code ..

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


    <ListView 
     android:stackFromBottom="true" 
     android:id="@+id/messages_list" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:divider="@null" 
     android:layout_marginBottom="60dp" 
     android:layout_marginTop="59dp"/> 


    <LinearLayout 
     android:animateLayoutChanges="true" 
     android:layout_gravity="bottom" 
     android:id="@+id/linearsend" 
     android:fitsSystemWindows="true" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical"> 

     <android.support.v7.widget.CardView 
      android:layout_width="match_parent" 
      xmlns:app="http://schemas.android.com/apk/res-auto" 
      app:cardCornerRadius="3dp" 
      android:layout_gravity="fill_horizontal" 
      android:layout_height="60dp" 

      android:elevation="2dp" 
      android:background="#c8ffffff"> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:orientation="horizontal" 
       android:scrollbars="vertical"> 
       <ImageView 
        android:id="@+id/imageSimly" 
        android:layout_margin="4dp" 
        android:layout_marginEnd="12dp" 
        android:layout_width="33dp" 
        android:layout_height="33dp" 
        android:layout_gravity="center|start" 
        android:src="@drawable/ic_mood_24dp"/> 
       <hani.momanii.supernova_emoji_library.Helper.EmojiconEditText 
        xmlns:emojicon="http://schemas.android.com/apklib/hani.momanii.supernova_emoji_library.Helper.EmojiconEditText" 
        android:id="@+id/new_messagee" 
        android:layout_gravity="center" 
        android:gravity="center_vertical" 
        android:layout_width="250dp" 
        android:layout_height="wrap_content" 
        android:textColor="#778BB0" 
        android:singleLine="true" 
        android:textColorHint="#778BB0" 
        android:hint="type a message..." 
        android:textSize="18sp" 
        emojicon:emojiconSize="20sp" /> 
       <android.support.design.widget.FloatingActionButton 
        android:layout_gravity="center|end" 
        android:elevation="2dp" 
        android:layout_width="40dp" 
        android:layout_height="40dp" 
        android:scaleType="center" 
        android:id="@+id/fabSend" 
        android:src="@drawable/ic_send_24dp" 

        /> 


      </LinearLayout> 


     </android.support.v7.widget.CardView> 


    </LinearLayout> 
    <include layout="@layout/app_bar"/> 
</FrameLayout> 
0

Ich glaube, Sie Margin zur Listenansicht geben.

+0

Ich versuchte, das zu überprüfen, aber es ist alles korrekt –

+0

Teilen Sie Ihren XML-Code. wenn möglich – anonymous

+0

Ich habe hinzugefügt, dass –

0

hinzufügen in XML-Datei

xmlns: card_view = "http://schemas.android.com/apk/res-auto" card_view: contentPadding = "- 3DD"

auch hinzufügen unterhalb der Linie, aber es ist optional, aber verwendbar in der Kartenansicht

card_view: cardPreventCornerOverlap = "false"

+0

'card_view: cardPreventCornerOverlap =" false "' wird Eckenradius entfernen ... n 'card_view: contentPadding =" - 3dp "' verschiebt nur den Inhalt innerhalb der Kartenansicht nicht den darüber liegenden Bereich –

+0

Bitte den folgenden Code eingeben und es überprüfen Vishal

+0

Thnks, aber es funktioniert nicht –

2

diesen Code Versuchen:

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    android:weightSum="1" 
    android:layout_gravity="fill_vertical" xmlns:android="http://schemas.android.com/apk/res/android"> 
    <include layout="@layout/app_bar"/> 
    <Space 
     android:layout_width="match_parent" 
     android:layout_height="2dp" 
     android:layout_gravity="center_horizontal"/> 
    <ListView 
     android:stackFromBottom="true" 
     android:layout_gravity="fill_vertical" 
     android:id="@+id/messages_list" 
     android:layout_weight="0.8" 

     android:layout_width="match_parent" 
     android:layout_height="0dp" 

     android:divider="@null"/> 


    <LinearLayout 
     android:animateLayoutChanges="true" 
     android:layout_gravity="bottom" 
     android:id="@+id/linearsend" 
     android:layout_weight="0.2" 
     android:fitsSystemWindows="true" 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:orientation="vertical"> 

     <android.support.v7.widget.CardView 
      android:layout_width="match_parent" 
      xmlns:app="http://schemas.android.com/apk/res-auto" 
      app:cardCornerRadius="3dp" 
      android:layout_gravity="fill_horizontal" 
      android:layout_height="60dp" 

      android:elevation="2dp" 
      android:background="#c8ffffff"> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:orientation="horizontal" 
       android:scrollbars="vertical"> 
       <ImageView 
        android:id="@+id/imageSimly" 
        android:layout_margin="4dp" 
        android:layout_marginEnd="12dp" 
        android:layout_width="33dp" 
        android:layout_height="33dp" 
        android:layout_gravity="center|start" 
        android:src="@drawable/ic_mood_24dp"/> 
       <hani.momanii.supernova_emoji_library.Helper.EmojiconEditText 
        xmlns:emojicon="http://schemas.android.com/apklib/hani.momanii.supernova_emoji_library.Helper.EmojiconEditText" 
        android:id="@+id/new_messagee" 
        android:layout_gravity="center" 
        android:gravity="center_vertical" 
        android:layout_width="250dp" 
        android:layout_height="wrap_content" 
        android:textColor="#778BB0" 
        android:singleLine="true" 
        android:textColorHint="#778BB0" 
        android:hint="type a message..." 
        android:textSize="18sp" 
        emojicon:emojiconSize="20sp" /> 
       <android.support.design.widget.FloatingActionButton 
        android:layout_gravity="center|end" 
        android:elevation="2dp" 
        android:layout_width="40dp" 
        android:layout_height="40dp" 
        android:scaleType="center" 
        android:id="@+id/fabSend" 
        android:src="@drawable/ic_send_24dp" 

        /> 


      </LinearLayout> 


     </android.support.v7.widget.CardView> 


    </LinearLayout> 
</LinearLayout> 
+0

es funktioniert nicht ... Der Raum ist immer noch da –

Verwandte Themen