Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲

RecyclerView 小技巧:軟鍵盤彈出時自動調整內容

編輯:關於 Android 開發

RecyclerView 小技巧:軟鍵盤彈出時自動調整內容

在 Activity 中設定 android:windowSoftInputMode="adjustResize",即可讓軟鍵盤彈出時自動縮放版面:

<activity ... android:windowSoftInputMode="adjustResize" />

若需要讓資料倒序呈現,可設定 LinearLayoutManager 的反向排列:

LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this); linearLayoutManager.setReverseLayout(true);

如此一來,資料便會以倒序方式排列。

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © Android教程網 All Rights Reserved