上QQ阅读APP看书,第一时间看更新
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).