2017-04-02 1 views
1

Dans mon style.xml:SearchView dans la barre d'outils a un paddingBottom quand fitsSystemWindows

<item name="android:windowTranslucentStatus">true</item> 

Dans mon toolbar.xml:

<android.support.v7.widget.Toolbar 
    android:id="@+id/toolbar" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:fitsSystemWindows="true" 
    app:layout_scrollFlags="scroll|enterAlways" 
    app:popupTheme="@style/AppTheme.PopupOverlay"> 

Et quand quelque chose que je d'entrée, il ressemble à: enter image description here

enter image description here

Donc mon question est: Pourquoi il a un rembourrage de fond? Et, comment utiliser fitsSystemWindows mais rendre le remplissage inférieur nul?

Ma solution temporaire est: utiliser Android: paddingTop = "XXdp" au lieu d'Android: fitsSystemWindows = "true"

mais pas élégant.

Répondre

0

Je viens de chercher sur Baidu et trouvé une solution parfaite.

http://www.th7.cn/Program/Android/201603/780326.shtml

ajouter ceci à manifast

android:windowSoftInputMode="adjustPan" 
+0

Cela m'a coûté beaucoup de temps à la recherche dans google et enfin obtenir une réponse dans website.WTF chinois –