8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Android TabLayoutを使用している時にソフトキーボード表示でタブが隠れるようにする

Posted at

ソフトキーボードを表示すると、タブがびよんと画面中央に表示。
あきらかに邪魔ですよね〜。

tab_up.png

これを無くすためには、Manifest.xmlの対象アクティビティに

AndroidManifest.xml
android:windowSoftInputMode="adjustPan|adjustResize"

AndroidManifest.xml
<activity
    android:name=".MainActivity"
    android:windowSoftInputMode="adjustPan|adjustResize"
    >

参考
http://developer.android.com/intl/ja/guide/topics/manifest/activity-element.html#wsoft

公式ドキュメントによれば、adjustPanがタブを押し上げない役目で、adjustResizeがソフトキーボードが出た時にアクティビティをソフトキーボードの分縮める役目を担っている模様。

tab_no.png

これで画面広々。

8
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?