Kintanpatel February 2016

Change DateTimepicker selection divider height

enter image description here here i am creating an application that has from date and to date picker in single page,so i want to display four view in one dialog.i got the Solucation using LinearLayout but the selection divider height is to large so How can i change to height of Date picker selection divider.here in snap i will display the problem. below is my xml code.

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:text="From Date Time"
        android:textStyle="bold" />

    <DatePicker


        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_weight="1"
        android:calendarViewShown="false"
        android:datePickerMode="spinner"
        android:scrollbarSize="@dimen/tab_min_width" />

    <TimePicker

        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_weight="1"
        android:timePickerMode="spinner" />

    <View
        android:layout_width="match_parent"
        android:layout_height="0.2dp"
        android:layout_margin="10dp"
        android:background="@android:color/black" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:text="To Date Time"
        android:textStyle="bold" />

    <DatePicker


        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_weight="1"
        android:calendarViewShown="false"
        android:datePickerMode="spinner" />

    <Time        

Answers


Harshiv February 2016

Don't know any other methods but probably, created a CustomTimePicker class which extends TimePicker, and then override the onDraw method -- OR -- change value of the variable used for it's height and keep the rest same?

Post Status

Asked in February 2016
Viewed 3,103 times
Voted 6
Answered 1 times

Search




Leave an answer