2017-04-02 73 views
1

在我style.xml:搜索查看工具欄中有一個paddingBottom來時fitsSystemWindows

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

在我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"> 

當我輸入的東西,它看起來像: enter image description here

enter image description here

所以我的問題是: 爲什麼它有一個底部填充?而且,如何使用fitsSystemWindows,但使底部填充爲零?

我的臨時解決方案是: 採用Android:paddingTop = 「XXdp」,而不是機器人:fitsSystemWindows = 「真」

,但它不優雅。

回答

0

我剛剛在百度上搜索,發現一個完美的解決方案。

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

只需添加這manifast

android:windowSoftInputMode="adjustPan" 
+0

我花了很多時間在谷歌搜索,最終得到中國website.WTF答案 –