2016-09-08 2 views
1

Quand j'utilisene peut pas trouver la méthode symbole setDropDownAnimationStyle (int) dans AutoCompleteTextView

AutoCompleteTextView search_edit = (AutoCompleteTextView) v.findViewById(R.id.auto_search); 
    search_edit.setDropDownAnimationStyle(R.style.MedicineListDropDown); 

i méthode get Vous ne trouvez pas setDropDownAnimationStyle (int) mais selon l'source code android il y a une méthode publique

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

alors pourquoi ai-je des erreurs?

+0

Peut-être que votre version de la bibliothèque n'a pas la méthode? –

+0

@ SelçukCihan Quelle version est utilisée dans le lien donné ci-dessus, de sorte que je peux utiliser la méthode. –

+0

Vérifié maintenant, vous ne pouvez pas utiliser la méthode, car il n'a pas encore fait son chemin dans l'API. Vois ma réponse. –

Répondre

1

La méthode que vous essayez d'utiliser est marquée comme masquée (approbation du conseil API en attente). C'est pourquoi vous ne pouvez pas l'utiliser.

/** 
* <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 
*/ 
  • Voir this question pour plus d'informations sur @hide. Il décrit un moyen d'utiliser la méthode, mais c'est vivement déconseillé.
  • Official documentation pour AutoCompleteTextView.