1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Android】 戻る処理ジェスチャー無効化

Last updated at Posted at 2025-09-04

概要

戻る処理ジェスチャー無効化する方法について解説。

方法

下記のようにsystemGestureExclusionRectsを使用すれば良い。

binding.hogeView.post {
    val rect = Rect(0, 0, binding.hogeView.width, binding.hogeView.height)
    binding.hogeView.systemGestureExclusionRects = listOf(rect)
}

注意
垂直方向200dpまでしか無効化できないため、画面全体を無効化することはできない

参考サイト

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?