在ScrollView中的佈局中有一個自動完成的textView。頁面焦點滾動回AutoCompleteTextView
mAutoCompleteTextView.addTextChangedListener(new TextValidator(mAutoCompleteTextView) {
@Override
public void validate(TextView textView, String text) {
if(text == null){
mAutoCompleteTextView.setError(text);
}
});
這顯示了一個紅色的錯誤圖標,並在文本無效的情況下顯示下拉錯誤消息。當錯誤可見並且頁面滾動時,頁面中心返回到此視圖而不是向上/向下滾動。
如何避免這種情況,而錯誤仍然可見?