Is it possible to make the default TimePicker smaller in the activity xml? I have searched this but so far only found out how to create a custom time picker which I do not want to do, or create a popup window which I also don't want to have to do. Has anyone tried this with any success? My TimePicker is sitting in a tableRow in a scrollView. Cheers
Asked
Active
Viewed 1.5k times
2 Answers
22
You can do this. I had also same problem. But Google helped me. You have to just change your XML file.
android:scaleY="0.90" & android:scaleX="0.90"
It will small your picker with percentage value which you provide.
Works only from API 11.

Sanjay Bhimani
- 1,593
- 1
- 15
- 29
-
Works only form API 11 – levi Dec 11 '14 at 20:57
-
The widget still occupies the same space... :/ – Mohsin Falak Sep 22 '20 at 23:21
14
You cannot change the size of TimePicker, how ever you can do one thing. You can make TimePicker as a Dialog.
Checkout the following code:
Button setTime;
setTime = (Button)findViewById(R.id.button1);
setTime.setOnClickListener(this);
public void onClick(View v)
{
TimePickerDialog tp1 = new TimePickerDialog(this, this, cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), true);
tp1.show();
}
public void onTimeSet(TimePicker view, int hourOfDay, int minute)
{
cal.set(Calendar.HOUR_OF_DAY, hourOfDay);
cal.set(Calendar.MINUTE, minute);
//rest of the code
}

Abhishek Dhiman
- 1,631
- 6
- 25
- 38
-
Yeah I think thats what ill have to end up doing. I have done the same for a date picker so I will probably make it the same. Thanks anyway – WillNZ Aug 30 '12 at 23:23
-
Hi there, I do not think this is the answer to the question but it seems the best solution so far as I have not found another way to do this. Thanks for your help – WillNZ Sep 03 '12 at 04:17
-