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

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).

主站蜘蛛池模板: 蒙自县| 武穴市| 贵州省| 吉林市| 阳东县| 高青县| 孝昌县| 修水县| 衢州市| 湖口县| 龙江县| 武平县| 枣强县| 延川县| 屏山县| 青神县| 枣阳市| 资兴市| 万安县| 新邵县| 孙吴县| 太湖县| 江川县| 抚远县| 墨竹工卡县| 伊宁县| 阳东县| 阿勒泰市| 揭西县| 屏东市| 淮北市| 深圳市| 宁国市| 柞水县| 环江| 旌德县| 邹城市| 阳西县| 曲靖市| 元氏县| 巴林右旗|