Check if Android device has software or hardware navigation buttons

后端 未结 2 1679
自闭症患者
自闭症患者 2021-01-04 19:38

I\'m writing an Android app with a transparent navigation bar. To adjust the layout accordingly, I need to know whether the device has software or hardware buttons.

2条回答
  •  迷失自我
    2021-01-04 20:36

    See this answer. You can get the real height of the display in pixels, and then get the height available to your app, and figure out if the device has an on-screen navigation bar with these values.

提交回复
热议问题