Forum Xamarin.iOS

UIToolbar disappearing after device rotation


I am struggling to find out what is causing a UIToolbar to disappear after the device is rotated, the toolbar correctly displays when it first comes into view however once the device is rotated the toolbar disappears but if rotated back its correctly displayed again. The toolbar only seems to be affected when the InputView is a date picker or time picker.

Below is the code used to create the toolbar if anyone could point me in the right direction that would be great.

// Create toolbar
UIToolbar timePickerToolBar = new UIToolbar();
UIBarButtonItem btn_SelectTime = new UIBarButtonItem("Done", UIBarButtonItemStyle.Plain, Btn_SelectTime_Clicked);

timePickerToolBar.SetItems(new UIBarButtonItem[] { flexibleSpace, btn_SelectTime }, false);

// add toolbar and set input view as timepicker
txt_Time.InputView = TimePicker;
txt_Time.InputAccessoryView = timePickerToolBar;




Sign In or Register to comment.