官术网_书友最值得收藏!

Platform specifics

While the UI controls offered by Xamarin.Forms are customizable enough for most UX requirements, additional native behaviors may be needed. For certain native control behaviors, platform-specific configuration can be accessed using the IElementConfiguration interface implementation of the target control. For instance, in order to change the UpdateMode picker (that is, Immediately or WhenFinished), you can use the On<iOS> method to access the platform-specific behavior:

 var picker = new Xamarin.Forms.Picker();
picker.On<iOS>().SetUpdateMode(UpdateMode.WhenFinished);

The same can be implemented in XAML using the Xamarin.Forms.PlatformConfiguration.iOSSpecific namespace:

<ContentPage 
...
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core">

<!-- ... -->
<Picker ios:Picker.UpdateMode="WhenFinished">
<!-- Removed for brevity -->
</Picker>
<!-- ... -->
</ContentPage>

Similar platform configurations are available for other controls and platforms within the same namespace (that is, Xamarin.Forms.PlatformConfiguration).

主站蜘蛛池模板: 雷山县| 林甸县| 镇平县| 闻喜县| 浦江县| 老河口市| 报价| 赞皇县| 疏勒县| 弥勒县| 康乐县| 壤塘县| 荆州市| 仲巴县| 德惠市| 禄劝| 囊谦县| 合江县| 凤冈县| 苍南县| 武胜县| 吕梁市| 汝城县| 岚皋县| 建始县| 大厂| 湖南省| 泊头市| 安吉县| 临邑县| 页游| 怀远县| 深圳市| 永平县| 甘肃省| 旬阳县| 三江| 临城县| 克山县| 正镶白旗| 肇庆市|