Android 滚动使整个屏幕变蓝
Android scrolling makes whole screen blue
我无法复制这个,但是有人知道什么可能导致 Android 设备上的整个屏幕变成浅蓝色吗?这似乎与选择单选按钮然后滚动有关。它发生在 Android 8.
的 Nexus 5x 上
这是它的样子:
我只听说过另外一个这样的例子。它可以是特定于设备的吗?奇怪的是,一旦它发生,它似乎就会保持这种状态,尽管用户说它有点间歇性。
更新:
这似乎只发生在 Android 8,如果这对任何人有帮助...
所以,我最终找到了有问题的代码。我证实这只发生在 Android 8 台设备上,也许只有三星?违规代码是:
mFormScrollView.setDescendantFocusability(ViewGroup.FOCUS_BEFORE_DESCENDANTS);
mFormScrollView.setFocusable(true);
mFormScrollView.setFocusableInTouchMode(true);
// Hide the keyboard when moving the screen up or down. This should only
// be an issue when
// on a text edit field. Also disable focus jump using
// "requestFocusFromTouch"
mFormScrollView.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View view, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_DOWN) {
Utilities.hideKeyBoard(FormActivity.this, view);
}
// Keeps screen from jumping to nearest EditText
// view.requestFocusFromTouch();
return false;
}
});
有问题的行已被注释掉 - view.requestFocusFromTouch()
方法,该方法旨在防止屏幕在隐藏键盘和失去焦点时自动跳转到下一个文本字段。在 Android 8 上没有发生这种情况,但我需要使用旧版本进行验证。
我无法复制这个,但是有人知道什么可能导致 Android 设备上的整个屏幕变成浅蓝色吗?这似乎与选择单选按钮然后滚动有关。它发生在 Android 8.
的 Nexus 5x 上这是它的样子:
我只听说过另外一个这样的例子。它可以是特定于设备的吗?奇怪的是,一旦它发生,它似乎就会保持这种状态,尽管用户说它有点间歇性。
更新:
这似乎只发生在 Android 8,如果这对任何人有帮助...
所以,我最终找到了有问题的代码。我证实这只发生在 Android 8 台设备上,也许只有三星?违规代码是:
mFormScrollView.setDescendantFocusability(ViewGroup.FOCUS_BEFORE_DESCENDANTS);
mFormScrollView.setFocusable(true);
mFormScrollView.setFocusableInTouchMode(true);
// Hide the keyboard when moving the screen up or down. This should only
// be an issue when
// on a text edit field. Also disable focus jump using
// "requestFocusFromTouch"
mFormScrollView.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View view, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_DOWN) {
Utilities.hideKeyBoard(FormActivity.this, view);
}
// Keeps screen from jumping to nearest EditText
// view.requestFocusFromTouch();
return false;
}
});
有问题的行已被注释掉 - view.requestFocusFromTouch()
方法,该方法旨在防止屏幕在隐藏键盘和失去焦点时自动跳转到下一个文本字段。在 Android 8 上没有发生这种情况,但我需要使用旧版本进行验证。