如何在 Xamarin 中 get/set AutoCompleteTextView 的文本值?
How to get/set text value of AutoCompleteTextView in Xamarin?
这个问题看起来微不足道,但我找不到 Xamarin 的解决方案。
AutoCompleteTextView
扩展了 EditText
class 所以你应该能够通过玩弄 Text
属性 来获取和设置文本这个:
var autocompleteTextView = FindViewById<AutoCompleteTextView>(Resource.Id.AutoCompleteInput);
string currentText = autocompleteTextView.Text;
autocompleteTextView.Text = "New text";
这个问题看起来微不足道,但我找不到 Xamarin 的解决方案。
AutoCompleteTextView
扩展了 EditText
class 所以你应该能够通过玩弄 Text
属性 来获取和设置文本这个:
var autocompleteTextView = FindViewById<AutoCompleteTextView>(Resource.Id.AutoCompleteInput);
string currentText = autocompleteTextView.Text;
autocompleteTextView.Text = "New text";