2017-05-01 36 views
-1

我有一個包含20行的ListView,列表視圖項不向上滾動時鍵盤apprear

item--1 
item--2 
. 
. 
item--19 
item--20 

這是滾動


列表最後的項目

項 - 17點擊 keyboad顯示其覆蓋editexs 現在item--15顯示

item--15 
EDITTEXT 
KEYBOARB 

此滾動高達項 - 15 我應用軟輸入調整平移

那麼現在 顯示item--17佈局上移

item--16 
item--17 
KEYBOARD 

現在滾動高達項 - 17 但我的問題是

item - 17我有下一個項目後-17和項目-19和項目-20

當鍵盤出現項目-17時,它只顯示卷軸。

未顯示下一項。 如何滾動最後的項目。

activity_main.xml中

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

     <ListView 
      android:id="@+id/list_item" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"> 
     </ListView> 
</LinearLayout> 
+0

後的XML代碼... –

+0

採用Android:windowSoftInputMode = 「stateHidden | adjustResize」 –

+0

哇工作,但EditText上光標焦點失去...如何集中維護的EditText –

回答

0

您清單活動標記把android:windowSoftInputMode="adjustPan|adjustResize"財產見下面的例子

<activity 
    android:name=".MainActivity" 
    android:label="@string/app_name" 
    android:screenOrientation="portrait" 
    android:windowSoftInputMode="adjustPan|adjustResize"> 

+0

不工作@Bhupat –

0

使用android:windowSoftInputMode="adjustPan"AndroidMainfest.xml或類文件中添加此getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);

1

你CAE使用RecycleView而不是列表視圖

+0

請解釋... –

相關問題