UIDatePicker in IOS 14 showing background tabBar in keyboard

Viewed 121

enter image description here

When using date picker in keyboard in IOS 14 getting this kind of output. It is not overlaying my tab bar controller in back. Can anyone help?

1 Answers

You can add the view in your current UIWindow which is accessible through root view of your ViewController like this:

self.view.window?.addSubview(calendarView)

And then make it overlay all other UIViews, like this:

self.view.window?.bringSubview(toFront: calendarView)
Related