我在 Xamarin.Forms 中有一个输入字段。
在 Android 上,我无法输入逗号或点来生成小数。该条目只接受整数。我必须更改什么才能输入小数?
xml:
<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));
}
}