语言

DateFormat.Lenient 属性

定义

返回封装的 Calendar 对象中的日期/时间分析以及 DateFormat 空格和数值处理是否宽松。 - 或 - 指定日期/时间分析是否宽松。

public virtual bool Lenient { [Android.Runtime.Register("isLenient", "()Z", "GetIsLenientHandler", ApiSince=24)] get; [Android.Runtime.Register("setLenient", "(Z)V", "GetSetLenient_ZHandler", ApiSince=24)] set; }
[<get: Android.Runtime.Register("isLenient", "()Z", "GetIsLenientHandler", ApiSince=24)>]
[<set: Android.Runtime.Register("setLenient", "(Z)V", "GetSetLenient_ZHandler", ApiSince=24)>]
member this.Lenient : bool with get, set

属性值

日历和数字输入和空格分析选项的组合宽大状态。

特性

注解

属性 getter 文档:

返回封装的 Calendar 对象中的日期/时间分析以及 DateFormat 空格和数值处理是否宽松。

Java文档android.icu.text.DateFormat.isLenient()。

属性 setter 文档:

指定日期/时间分析是否宽松。 使用宽松分析,分析器可以使用启发法来解释与此对象格式不匹配的输入。 如果不进行宽大分析,输入必须更紧密地匹配此对象的格式。 <br><br>注意: ICU 53 引入了更精细的宽大控制(并添加了新的控制点),使首选方法成为 setCalendarLenient() 和 setBooleanAttribute() 调用的组合。 此方法支持以前的功能,但可能不支持 DateFormat 的所有未来宽大控制和行为。 若要控制 53 前宽大、日历和 DateFormat 空格和数值容差,此方法是安全的。 但是,通过此方法混合宽大控制,并通过 setBooleanAttribute() 修改较新的属性可能会导致不良结果。

Java文档android.icu.text.DateFormat.setLenient(boolean)。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于