由于 MvvmCross 从 4.2.3 更新到 4.4.0,我之前运行的 MvvmCross Android 应用程序现在损坏了
<EditText
android:layout_width="match_parent"
android:layout_height="match_parent"
local:MvxBind="Text Login" />
public string Login
{
get { return _login; }
set { SetProperty(ref _login, value); }
}
LinkerPleaseIninclude 如果当然有的话:
public void Include(EditText text)
{
text.Enabled = !text.Enabled;
text.TextChanged += (sender, args) => text.Text = "" + text.Text;
text.Hint = "" + text.Hint;
text.Click += (s, e) => text.Visibility = text.Visibility - 1;
}
public void Include(TextView text)
{
text.TextChanged += (sender, args) => text.Text = "" + text.Text;
text.Hint = "" + text.Hint;
text.Click += (s, e) => text.Text = text.Text + "";
}
链接器“仅限 SDK”已启用。
对于禁用的链接器,它工作正常。
其他绑定也可以正常工作(按钮点击、可见性等)。
如何告诉链接器正确处理这个问题?
这里可能出了什么问题?
绑定目标为EditText
and TextView
使用AfterTextChanged
事件,这可能会被链接起来。将其添加到您的 Include 方法中而不是TextChanged
它应该起作用:
public void Include(TextView text)
{
text.AfterTextChanged += (sender, args) => text.Text = "" + text.Text;
text.Hint = "" + text.Hint;
text.Click += (s, e) => text.Text = text.Text + "";
}
我认为你不需要一个单独的方法EditText
as EditText
继承自TextView
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)