【发布时间】:2020-08-10 17:12:58
【问题描述】:
我在 Xamarin.Forms 中有一个输入字段。
在 Android 上,我无法输入逗号或点来生成小数。该条目只接受整数。我必须更改什么才能输入小数?
Xaml:
<Entry Keyboard="Numeric" Text="{Binding Price1}" Placeholder="Price"/>
内容页cs:
private decimal price1;
public string Price1
{
get { return (price1).ToString(); }
set
{
price1 = Convert.ToDecimal((String.IsNullOrEmpty(value)) ? null : value);
OnPropertyChanged(nameof(Price1));
}
}
【问题讨论】:
标签: c# xamarin xamarin.forms xamarin.android xamarin.forms.entry