Forum Xamarin.Forms

Has anyone used visual="Material" with DatePIcker?

I've tried to use visual="Material" with DatePicker, but it's not working. Other controls such as 'Checkbox' etc. are working fine, but DatePicker doesn't have any Material effect.

Best Answer

Answers

  • YelinzhYelinzh Member, Xamarin Team Xamurai
    edited December 2019

    I've tried to use visual="Material" with DatePicker, but it's not working

    I've tested the feature on a demo which works well as shown. What are the Xamarin.Forms and Material package versions in your test demo? Check the official sample, which contains the Picker part.

    To enable Material Visual in your application:

    • Install the Xamarin.Forms.Visual.Material NuGet package to PCL and platform projects.
    • The Material renderers must be initialized in each platform project.
    • Set the VisualElement.Visual property on a page, layout, or view, to Material.
    <DatePicker />
    
    <DatePicker Visual="Material"/>
    


    Tutorial: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/visual/material-visual#apply-material-visual

  • tousif03razatousif03raza INMember ✭✭

    @Jarvan Thanks for the reply.

    It's working fine on Android. But, how does it look in iOS?

    Still, the DatePicker in iOS appears from the bottom. Isn't it should be open in a Popup like 'Android'?

  • tousif03razatousif03raza INMember ✭✭

    @Jarvan

    Okay, Thanks.

Sign In or Register to comment.