Android 在AutoCompleteTextView中找不到符号方法setDropDownAnimationStyle(int)

Android 在AutoCompleteTextView中找不到符号方法setDropDownAnimationStyle(int),android,autocompletetextview,Android,Autocompletetextview,当我使用 AutoCompleteTextView search_edit = (AutoCompleteTextView) v.findViewById(R.id.auto_search); search_edit.setDropDownAnimationStyle(R.style.MedicineListDropDown); 我找不到setDropDownAnimationStyle(int)方法,但根据android,有一个公共方法 public void setDropDo

当我使用

 AutoCompleteTextView search_edit = (AutoCompleteTextView) v.findViewById(R.id.auto_search);
    search_edit.setDropDownAnimationStyle(R.style.MedicineListDropDown);
我找不到setDropDownAnimationStyle(int)方法,但根据android,有一个公共方法

 public void setDropDownAnimationStyle(int animationStyle) {
    mPopup.setAnimationStyle(animationStyle);
}

那么我为什么会出错呢?

您尝试使用的方法被标记为隐藏(等待API委员会批准)。这就是为什么你不能使用它

 /**
 * <p>Sets the animation style of the auto-complete drop-down list.</p>
 *
 * <p>If the drop-down is showing, calling this method will take effect only
 * the next time the drop-down is shown.</p>
 *
 * @param animationStyle animation style to use when the drop-down appears
 *      and disappears.  Set to -1 for the default animation, 0 for no
 *      animation, or a resource identifier for an explicit animation.
 *
 * @hide Pending API council approval
 */
/**
*设置自动完成下拉列表的动画样式

* *如果显示下拉列表,则调用此方法只会生效 *下次显示下拉列表时

* *@param animationStyle下拉列表出现时要使用的动画样式 *然后消失了。默认动画设置为-1,否设置为0 *动画,或显式动画的资源标识符。 * *@hide待API理事会批准 */
  • 有关@hide的信息,请参阅。它描述了一种使用该方法的方法,但强烈建议不要使用该方法
  • 对于
    AutoCompleteTextView

可能您的库版本没有该方法?@SelçukCihan上面给出的链接中使用了什么版本,以便我可以使用该方法。现在检查该方法,您不能使用该方法,因为它尚未进入api。看看我的答案。