【发布时间】:2016-11-15 07:45:12
【问题描述】:
我的屏幕顶部有一个AutoCompleteTextView,并使用与AutoCompleteTextView 关联的默认列表来显示我的数据。我的屏幕底部有一个底部导航栏,即使显示建议也可见。
我面临的问题是,当弹出窗口的列表中有太多建议时,它会覆盖我的底部导航栏(列表在底部导航栏的顶部)。我想通过给 PopupWindows ListView 留出余量或者控制 popupWindow 的高度来防止这种情况发生。有一个 API setDropdownHeight(),但没有 marginBottom 或限制视图底部填充整个屏幕的方法。
/**
* <p>Sets the current height for the auto-complete drop down list. This can
* be a fixed height, or {@link ViewGroup.LayoutParams#MATCH_PARENT} to fill
* the screen, or {@link ViewGroup.LayoutParams#WRAP_CONTENT} to fit the height
* of the drop down's content.</p>
*
* @param height the height to use
*
* @attr ref android.R.styleable#AutoCompleteTextView_dropDownHeight
*/
public void setDropDownHeight(int height) {
mPopup.setHeight(height);
}
AutoCompleteTextView 中的 API 提供了使用 anchor、verticalOffset 等 API 来执行此列表顶部/开头的选项。但我无法找到用于执行此操作的 API底部。有没有办法做到这一点?
【问题讨论】:
标签: android autocompletetextview android-popupwindow