gpt4 book ai didi

android - 我们如何通过 mvvmcross 绑定(bind)在 Android 的 SearchView 中输入的搜索文本

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:35:02 25 4
gpt4 key购买 nike

我正在使用 Xamarin Android 和 MvvmCross 开发一个应用程序。 MvvmCross 有助于将布局中的 View 属性直接绑定(bind)到 ViewModel。对于 EditText,我们可以像这样绑定(bind)文本

<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
local:MvxBind="Text Property" />

我需要使用 MvvmCross 绑定(bind) SearchView 文本。我尝试了如下所示的 Text 但它不起作用。

<SearchView     
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:queryHint="Customer name"
local:MvxBind="Text SearchString" />

如何使用 MvvmCross 绑定(bind) SearchView 文本?

最佳答案

对于 SearchView,您需要使用 Query属性:

<SearchView     
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:queryHint="Customer name"
local:MvxBind="Query SearchString" />

关于android - 我们如何通过 mvvmcross 绑定(bind)在 Android 的 SearchView 中输入的搜索文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39099010/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com