Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 41198 on
Developer Community or GitHub if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
Using the OOB Xamarin.Forms.TimePicker you will notice on Android that the TimePicker layout is dynamically responsive to portrait vs. landscape orientation changes. If you wrap it in a custom ViewRenderer that responsive layout no longer functions. In the custom Renderer, the best I can do is "new up" another TimePickerDialog on each EditText click which will display the TimePicker appropriately for the current orientation but the picker is not responsive for changes from landscape to portrait or vice versa.
[assembly: ExportRenderer(typeof(DurationPicker), typeof(DurationPickerRenderer))]
public class DurationPickerRenderer : ViewRenderer<Xamarin.Forms.TimePicker, EditText>, TimePickerDialog.IOnTimeSetListener
TimePickerDialog dialog = null;
protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.TimePicker> e)
if (null == Control)
editText = new EditText(Forms.Context)
// My Humanized text
editText.Text = (this.Element as DurationPicker).DurationText;
editText.KeyListener = null;
if (null != e.OldElement)
editText.Click -= Control_Click;
editText.FocusChange -= Control_FocusChange;
if (null != e.NewElement)
editText.Click += Control_Click;
editText.FocusChange += Control_FocusChange;
void Control_FocusChange(object sender, Android.Views.View.FocusChangeEventArgs e)
void Control_Click(object sender, EventArgs e)
private void ShowTimePicker()
// Displays in current orientation and remains in current orientation
// regardless of subsequent clicks or orientation changes
//if (null == dialog)
// dialog = new TimePickerDialog(Context, this, this.Element.Time.Hours, this.Element.Time.Minutes, true);
// Displays in current orientation every click but layout is not
// responsive to subsequent orientation changes
new TimePickerDialog(Context, this, this.Element.Time.Hours, this.Element.Time.Minutes, true)
public void OnTimeSet(Android.Widget.TimePicker view, int hourOfDay, int minute)
var time = new TimeSpan(hourOfDay, minute, 0);
// My Humanized text
this.Control.Text = (this.Element as DurationPicker).DurationText;
The responsive effect on the OOB Xamarin.Forms.TimePicker is visible on Android Lollipop v5.x or higher.
Hi please take a look at DatePicker we fixed this issue there , seems we need to port that fix to TimePicker too.
Basically we recreate the dialog on orientation changes.
You could make a PR with that fix too if you have time.
For me, this works on AppCompat / API 23.