How to show only year in DatePicker?(Xamarin Android)

V, Kavyasri 41 Reputation points
2023-01-04T09:00:48.97+00:00

I need to show only the year in date picker (Xamarin Android).Is that possible or is there any other way to achieve it?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,369 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Takahito Iwasa 4,851 Reputation points MVP
    2023-01-04T11:21:34.423+00:00

    Hi, @V, Kavyasri

    This is a little more difficult.
    I think you need an approach to Android native controls.

    See the following SO thread.

    https://stackoverflow.com/questions/10233760/remove-year-from-datepickerdialog

    Here we access the parts of the DatePicker component to hide the year.
    You should be able to customize it in the same way, such as showing only the year.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.