我有一个
TextView
绑定为Enabled,
Clickable
然后单击。当
activity
加载、启用和;
可点击
被绑定为假值,但
文本框
无法禁用(&D);仍然可以点击。将绑定值更改为true后(&A);然后是false
文本框
已禁用。
我发现这个问题与绑定Click事件有关。一旦点击被绑定,就会出现上述问题。在不绑定Click事件的情况下,它可以按预期工作。
在以下示例代码中,前2个
TextViews
都还好。最后一个具有绑定单击的选项不起作用。
顺便说一句,我有这个问题
TextInputEditText
相反我发现这种情况适用于
文本框
我也这么用
文本框
用于说明。
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="test textview can be disabled at load"
style="@style/EntryTextStyle"
local:MvxBind=" Enabled RouteMarker.ArrivalNotice" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="test textview with no click command, can be disabled at load"
style="@style/EntryTextStyle"
local:MvxBind=" Enabled RouteMarker.ArrivalNotice;
Clickable RouteMarker.ArrivalNotice" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="test textview with click command cannot be disabled at load"
style="@style/EntryTextStyle"
local:MvxBind=" Enabled RouteMarker.ArrivalNotice;
Clickable RouteMarker.ArrivalNotice;
Click DoSomethingCommand" />
private IMvxAsyncCommand _doSomethingCommand;
public IMvxAsyncCommand DoSomethingCommand
{
get
{
_doSomethingCommand = _doSomethingCommand ?? new MvxAsyncCommand(async () =>
{
await Task.Delay(10);
});
return _doSomethingCommand;
}
}
知道如何修复吗?
谢谢