Styling an Android edit text so as to look like a drop down / spinner picker

android, android-layout, android-view, xamarin.android

Solution

set the Style attribute to the following:

 <EditText
        style="?android:attr/spinnerStyle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        />

Problem

I have two EditText views on a layout containing a date and a time. On being clicked these open up my custom DatePickerFragment and a TimePickerFragments. I would like to style the EditTexts with a picker drop corner as the following image shows. however I have not been able to do this, my text fields look like this: The pickers all work and are hooked up and return values to the EditTexts, I just want to do the styling correctly. I am happy to change the class of the containers from EditText if they should be something else to get the desired behaviour. I think this should be possible as the first image comes from Google's own design documentation. Looking through the EditText and TextView class documentation and xml attibute documentation. Is there a way to do this? I am using Xamarin to compile this down but that should make no difference to the answer.

Original source