CommonMan
CommonMan

Reputation: 3928

DatePicker UI Rendering Issue

I have been trying to use a DatePicker but there is a strange problem in the UI rendering of it.

Below is the screen shot of the UI:

Below is the screen shot of UI

Whereas I want it like below:

Expected

Has anyone seen this before? How can I solve it?

Below is the XML layout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
  <DatePicker
    android:id="@+id/dpResult"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />
</RelativeLayout>

Upvotes: 1

Views: 325

Answers (1)

NasaGeek
NasaGeek

Reputation: 2198

If you don't want the full calendar view and just want to see the spinners on the date picker, use the calendarViewShown attribute and set it to false. If the DatePicker is still oddly rendered, it might indicate that you have set some unnecessary attributes in the app's theme.

Upvotes: 1

Related Questions