How can I reduce the size (height and width) of a DatePicker? Is there any built-in method available for this?
I think we can not reduce the actual size of the date picker view but we can use scaling and negative padding properties to make the date picker look smaller.
Scaling down the date picker by using android:scaleY and android:scaleX attributes will make the picker to look smaller but still take the same amount of view space inside the activity/ fragment. To remove the extra space around the scaled down version of date picker we can use negative padding.
For example, if we want to place two scaled down version of date pickers side by side without leaving much gap between them, then we can do so by adjusting the padding as shown below:
Above example shows placing the 2 date pickers side by side but we can place any other view beside a date picker by adjusting the padding as shown above.