当我使用
AutoCompleteTextView search_edit = (AutoCompleteTextView) v.findViewById(R.id.auto_search);
search_edit.setDropDownAnimationStyle(R.style.MedicineListDropDown);
我得到找不到方法setDropDownAnimationStyle(int)但根据android source code有一个公共方法
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
*/
有关@hide的信息,请参见this question。它描述了一种使用该方法的方法,但强烈建议您不要这样做。
AutoCompleteTextView
的Official documentation。