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

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

主站蜘蛛池模板: 抚州市| 湖口县| 永城市| 衢州市| 阳曲县| 曲周县| 渭源县| 沈丘县| 滁州市| 大埔区| 宜都市| 沁水县| 湘潭市| 亚东县| 绍兴市| 罗源县| 洛扎县| 宣武区| 山阳县| 洪洞县| 鱼台县| 沂南县| 独山县| 卢龙县| 翁牛特旗| 沅陵县| 遂昌县| 永和县| 涞水县| 邢台市| 泸州市| 惠来县| 兴安县| 喀喇沁旗| 古浪县| 荔浦县| 靖江市| 定边县| 龙川县| 诸暨市| 台东市|