当我在MvxAutoCompleteTextView中输入“aa”时。没有显示下拉列表。 任何人都知道如何使用MvxAutoCompleteTextView?在Mvvmcross NPlus1Days和Tutorials.Thanks
中没有例子布局
<MvxAutoCompleteTextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
local:MvxBind="Text SearchKey; ItemsSource ListAddresses; PartialText LabelTitle; SelectedObject Address" />
视图模型
private string _SearchKey;
public string SearchKey
{
get { return _SearchKey; }
set { _SearchKey = value; RaisePropertyChanged(() => SearchKey); }
}
private List<string> _ListAddresses = new List<string>(){ "aa", "bb", "cc" };
public List<string> ListAddresses
{
get { return _ListAddresses; }
set { _ListAddresses = value; RaisePropertyChanged(() => ListAddresses); }
}
private string _LabelTitle;
public string LabelTitle
{
get { return _LabelTitle; }
set { _LabelTitle = value; RaisePropertyChanged(() => LabelTitle); }
}
private string _Address;
public string Address
{
get { return _Address; }
set { _Address = value; RaisePropertyChanged(() => Address); }
}
答案 0 :(得分:1)
答案 1 :(得分:0)
我也很难控制这个控件,Jim的例子帮了很多忙。 This answer警告反对约束Text
,我认为这有一些优点纯粹是因为对我而言,控制权只有一半。绑定到Text
时,列表视图会出现,但我永远无法绑定SelectedObject
或PartialText
。我注意到我收到了以下绑定错误:
错误 - MvxAutoCompleteTextViewPartialTextTargetBinding中的autoComplete为空
对我来说,简单的解决方法就是改变
<MvxAutoCompleteTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
... />
到
<Mvx.MvxAutoCompleteTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
... />