【问题标题】:Android Snackbar covering the control buttons in Google PixelAndroid Snackbar 覆盖 Google Pixel 中的控制按钮
【发布时间】:2017-04-25 02:01:34
【问题描述】:

Snackbar 覆盖了 Google Pixel 设备的控制按钮。设备正在运行 Nougat,屏幕截图说明了问题:

这是由于按钮是虚拟的。在控制按钮为虚拟的设备中,需要进行哪些更改才能避免此问题?

代码:

Snackbar.make(MainActivity.this.getWindow().getDecorView(), getString(R.string.incorrect_details), Snackbar.LENGTH_LONG).show();

【问题讨论】:

  • 尝试在第一个参数中使用findViewById(android.R.id.content)

标签: android android-7.0-nougat android-snackbar


【解决方案1】:

作为第一个参数android.R.id.content

 Snackbar.make(findViewById(android.R.id.content), getString(R.string.incorrect_details), Snackbar.LENGTH_LONG).show();

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-01-06
    • 1970-01-01
    • 2012-04-10
    • 2023-03-23
    • 1970-01-01
    • 2018-10-16
    • 1970-01-01
    相关资源
    最近更新 更多