我试图绑定:Android的数据绑定浮到TextView的
@Bindable
public float getRoundInEditAmount()
{
return roundInEdit.getAmount();
}
@Bindable
public void setRoundInEditAmount(float amount)
{
roundInEdit.setAmount(amount);
notifyPropertyChanged(BR.roundInEditAmount);
}
到
<EditText
android:layout_width="100dp"
android:layout_height="50dp"
android:inputType="numberDecimal"
android:text="@={`` + weightSet.roundInEditAmount}"
></EditText>
然而在点击我提出了一个文本输入没有数字键盘的EditText。如果我再次点击这个EditText,我会看到数字键盘。如果该字段默认为50.0或其他值,我不能删除这些金额。我可以输入文字,但它仍然存在。
有没有其他人遇到过这种行为,文本输入是在第一次点击而不是数字键盘上出现的? EditText上的双向绑定也按照我期望的方式工作。我已经编写了自己的Binding和InverseBinding适配器,它们的行为方式相同 - >首先点击TextInput,然后点击第二次点击,但不能删除开始的数字。
你能解释为什么你需要第一次点击textpad输入和第二次点击numberpad? –
如果你阅读这个问题,你会发现这不是必需的,而是实际的行为。 – Luthervd
嗨,roundInEdit是什么类型的变量 –